From f38cf3cb34addaa53d1f855d7607b151082a4229 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 1 Sep 2008 11:17:29 -0400 Subject: 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" --- resize/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'resize/main.c') 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 +#ifdef HAVE_STDLIB_H +#include +#endif #include #include #include @@ -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)) -- cgit v1.2.3