]> granicus.if.org Git - strace/commitdiff
tests: check unexpected syscall errors returned by stat family syscalls
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 17 Mar 2017 20:15:20 +0000 (20:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 17 Mar 2017 20:15:20 +0000 (20:15 +0000)
* tests/xstatx.c (main) [!OLD_STAT]: Do not skip the test
in case of EOVERFLOW.
Treat errors other than ENOSYS and EOVERFLOW as fatal.

tests/xstatx.c

index 874f3090289d5fadb2d9cb2122ffbb6940d07614..6eb760b54f1ec3d8f96eb0760e7fd433a5f40e62 100644 (file)
@@ -237,13 +237,11 @@ main(void)
 # endif
 
        if ((rc = TEST_SYSCALL_INVOKE(sample, st))) {
-# if OLD_STAT
-               if (errno != EOVERFLOW)
-# endif
-               {
+               if (errno != EOVERFLOW) {
+                       rc = (errno == ENOSYS) ? 77 : 1;
                        perror(TEST_SYSCALL_STR);
                        (void) unlink(sample);
-                       return 77;
+                       return rc;
                }
        }
        (void) unlink(sample);