]> granicus.if.org Git - strace/commitdiff
tests/iopl.c: use errno2name
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 21 Apr 2016 20:59:46 +0000 (20:59 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 21 Apr 2016 22:05:55 +0000 (22:05 +0000)
tests/iopl.c

index 3d379d42ff8d62bad9dfb25cc8f876c48caf3ae6..a3e982729b160b5e64eba54e8a4f28f2479d0d58 100644 (file)
@@ -11,18 +11,7 @@ int
 main(void)
 {
        long rc = syscall(__NR_iopl, 4);
-       const char *error_text;
-       switch (errno) {
-               case ENOSYS:
-                       error_text = "ENOSYS";
-                       break;
-               case EPERM:
-                       error_text = "EPERM";
-                       break;
-               default:
-                       error_text = "EINVAL";
-       }
-       printf("iopl(4) = %ld %s (%m)\n", rc, error_text);
+       printf("iopl(4) = %ld %s (%m)\n", rc, errno2name());
 
        puts("+++ exited with 0 +++");
        return 0;