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

index 6281fcf67cd22daf7e2793da13d07e77801b5ff0..11883600fe608b885514f2d1350002eae9cb634a 100644 (file)
@@ -41,7 +41,6 @@ int
 main(void)
 {
        static const char sample[] = "fchmodat_sample";
-       const char *err;
 
        if (open(sample, O_RDONLY | O_CREAT, 0400) == -1)
                perror_msg_and_fail("open");
@@ -54,16 +53,10 @@ main(void)
 
                if (syscall(__NR_fchmodat, -100, sample, 0600) != -1)
                        perror_msg_and_fail("fchmodat");
-
-               err = "ENOENT";
-       } else {
-               if (errno != ENOSYS)
-                       perror_msg_and_fail("fchmodat");
-               err = "ENOSYS";
        }
 
        printf("fchmodat(AT_FDCWD, \"%s\", 0600) = -1 %s (%m)\n",
-              sample, err);
+              sample, errno2name());
 
        puts("+++ exited with 0 +++");
        return 0;