]> granicus.if.org Git - strace/commitdiff
tests/fchmod.c: use errno2name
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 21 Apr 2016 20:39:40 +0000 (20:39 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 21 Apr 2016 20:52:42 +0000 (20:52 +0000)
tests/fchmod.c

index d9ef93ed91d126edafc4c164b69037b75913c0d6..13fd4d073f4f688600571f298d270d283930b204 100644 (file)
@@ -56,15 +56,8 @@ main(void)
 
                if (syscall(__NR_fchmod, fd, 0600) != -1)
                        perror_msg_and_fail("fchmod");
-
-               printf("fchmod(%d, 0600) = -1 EBADF (%m)\n", fd);
-       } else {
-               if (errno == ENOSYS) {
-                       printf("fchmod(%d, 0600) = -1 ENOSYS (%m)\n", fd);
-               } else {
-                       perror_msg_and_fail("fchmod");
-               }
        }
+       printf("fchmod(%d, 0600) = -1 %s (%m)\n", fd, errno2name());
 
        puts("+++ exited with 0 +++");
        return 0;