summaryrefslogtreecommitdiff
path: root/resize/main.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-09-01 11:17:29 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-09-01 11:36:53 -0400
commitf38cf3cb34addaa53d1f855d7607b151082a4229 (patch)
tree9fd7e5fb2dc58b3b42b1aa482ffa8cf1b7cd0918 /resize/main.c
parent7fd2651f67a43fad3cc1cc2db7c0e5f9c568023c (diff)
downloade2fsprogs-f38cf3cb34addaa53d1f855d7607b151082a4229.tar.gz
Only use the test_io manager if the right environment variables are set
In order to make it possible for the test_io manager to be compiled in by default, make all of the programs that might try to use it to only do so if the environment variables TEST_IO_FLAGS and TEST_IO_DEBUG are set. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'resize/main.c')
-rw-r--r--resize/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/resize/main.c b/resize/main.c
index aeac24bc..d6ecd8b3 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -22,6 +22,9 @@ extern char *optarg;
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>
@@ -290,10 +293,12 @@ int main (int argc, char ** argv)
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))