From 68cb82e0f1f8b83484354525aebcfffc3366c037 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 17 Jun 2015 20:58:33 +0000 Subject: [PATCH] tests: skip stat32 test if struct stat is defined incorrectly If stat.st_mode returned by syscall is 0, it means that the definition of struct stat in is incorrect. This is the case e.g. on mips n32 where the only available stat syscall is 64-bit but at the same time struct stat defined by is 32-bit. * tests/stat.c (main) [NR_stat]: Return 77 if st_mode is 0. --- tests/stat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/stat.c b/tests/stat.c index 2b040105..0dbbb721 100644 --- a/tests/stat.c +++ b/tests/stat.c @@ -111,6 +111,8 @@ main(int ac, const char **av) if (sizeof(stb.st_size) > 4) return 77; assert(syscall(NR_stat, av[1], &stb) == 0); + if (!stb.st_mode) + return 77; #else assert(stat(av[1], &stb) == 0); #endif -- 2.40.0