summaryrefslogtreecommitdiff
path: root/tests/fs-tests/integrity
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-12 11:46:20 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-18 17:44:45 +0300
commit43f5dbec6e9dc2b17e40e9c1cbb09f74fb882a8d (patch)
tree2184ab41530831ee6cf91576e04f6ef94411dc8b /tests/fs-tests/integrity
parent4b564cca7f1fc950ebdb895e0f88fbe2d644b9d3 (diff)
fs-tests: integck: make integck function return error
Turn the 'void integck(void)' function into 'static int integck(void)'. We need to teach the test to gracefully handle some error cases like 'EROFS' instead of failing and exiting straight away. And the ground work for this is making all functions return errors. This is the first tiny step in this direction. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests/fs-tests/integrity')
-rw-r--r--tests/fs-tests/integrity/integck.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index ebe4995..3ee20b2 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -1951,7 +1951,7 @@ static void update_test_data(void)
do_an_operation();
}
-void integck(void)
+static int integck(void)
{
pid_t pid;
int64_t rpt;
@@ -1978,7 +1978,7 @@ void integck(void)
top_dir = dir_new(NULL, dir_name);
if (!top_dir)
- return;
+ return -1;
srand(pid);
@@ -2012,6 +2012,8 @@ void integck(void)
close_open_files();
tests_clear_dir(dir_name);
CHECK(rmdir(dir_name) != -1);
+
+ return 0;
}
/*
@@ -2151,6 +2153,9 @@ int main(int argc, char *argv[])
}
/* Do the actual test */
- integck();
- return 0;
+ ret = integck();
+ if (ret)
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
}