diff options
Diffstat (limited to 'io')
-rw-r--r-- | io/tst-statvfs.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/io/tst-statvfs.c b/io/tst-statvfs.c index 227c62d7da..f3097ce1a8 100644 --- a/io/tst-statvfs.c +++ b/io/tst-statvfs.c @@ -1,5 +1,7 @@ #include <stdio.h> +#include <sys/statfs.h> #include <sys/statvfs.h> +#include <support/check.h> /* This test cannot detect many errors. But it will fail if the @@ -11,17 +13,18 @@ do_test (int argc, char *argv[]) for (int i = 1; i < argc; ++i) { struct statvfs st; - if (statvfs (argv[i], &st) != 0) - printf ("%s: failed (%m)\n", argv[i]); - else - printf ("%s: free: %llu, mandatory: %s\n", argv[i], - (unsigned long long int) st.f_bfree, + struct statfs stf; + TEST_COMPARE (statvfs (argv[i], &st), 0); + TEST_COMPARE (statfs (argv[i], &stf), 0); + TEST_COMPARE (st.f_type, stf.f_type); + printf ("%s: free: %llu, mandatory: %s, tp=%x\n", argv[i], + (unsigned long long int) st.f_bfree, #ifdef ST_MANDLOCK - (st.f_flag & ST_MANDLOCK) ? "yes" : "no" + (st.f_flag & ST_MANDLOCK) ? "yes" : "no", #else - "no" + "no", #endif - ); + st.f_type); } return 0; } |