ctx->superblock = ctx->use_superblock;
restart:
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
flags = EXT2_FLAG_NOFREE_ON_ERROR;
if ((ctx->options & E2F_OPT_READONLY) == 0)
flags |= EXT2_FLAG_RW;
#endif
#include <pwd.h>
#include <stdio.h>
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#endif
#include <string.h>
#include <time.h>
#include <unistd.h>
}
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
retval = ext2fs_open (image_fn, open_flag, 0, 0,
io_ptr, &fs);
#include <stdio.h>
#include <unistd.h>
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#endif
#include <ctype.h>
#include <string.h>
#include <time.h>
PRS(argc, argv);
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
retval = ext2fs_open (device_name, open_flag, 0, 0, io_ptr, &fs);
if (retval)
exit(1);
io_manager io_ptr;
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
retval = ext2fs_open(journal_device,
EXT2_FLAG_JOURNAL_DEV_OK, 0,
0, io_ptr, &jfs);
PRS(argc, argv);
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
if (should_do_undo(device_name)) {
retval = mke2fs_setup_tdb(device_name, &io_ptr);
#endif
#include <pwd.h>
#include <stdio.h>
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#endif
#include <string.h>
#include <time.h>
#include <unistd.h>
}
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
retval = ext2fs_open(journal_path, EXT2_FLAG_RW|
EXT2_FLAG_JOURNAL_DEV_OK, 0,
fs->blocksize, io_ptr, &jfs);
check_plausibility(journal_device);
check_mount(journal_device, 0, _("journal"));
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
retval = ext2fs_open(journal_device, EXT2_FLAG_RW|
EXT2_FLAG_JOURNAL_DEV_OK, 0,
fs->blocksize, io_ptr, &jfs);
parse_tune2fs_options(argc, argv);
#ifdef CONFIG_TESTIO_DEBUG
- io_ptr = test_io_manager;
- test_io_backing_manager = unix_io_manager;
-#else
- io_ptr = unix_io_manager;
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_DEBUG")) {
+ io_ptr = test_io_manager;
+ test_io_backing_manager = unix_io_manager;
+ } else
#endif
+ io_ptr = unix_io_manager;
retry_open:
retval = ext2fs_open2(device_name, io_options, open_flag,
extern int optind;
#endif
#include <unistd.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
fd = -1;
}
- if (flags & RESIZE_DEBUG_IO) {
+#ifdef CONFIG_TESTIO_DEBUG
+ if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
io_ptr = test_io_manager;
test_io_backing_manager = unix_io_manager;
} else
+#endif
io_ptr = unix_io_manager;
if (!(mount_flags & EXT2_MF_MOUNTED))