From: Dmitry V. Levin Date: Thu, 21 Apr 2016 20:30:25 +0000 (+0000) Subject: tests/chroot.c: use errno2name X-Git-Tag: v4.12~366 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adbbc2d288d76775114a3dca64768365a9e019ff;p=strace tests/chroot.c: use errno2name --- diff --git a/tests/chroot.c b/tests/chroot.c index fb12a316..40300b90 100644 --- a/tests/chroot.c +++ b/tests/chroot.c @@ -11,20 +11,10 @@ int main(void) { static const char sample[] = "chroot.sample"; - int rc = syscall(__NR_chroot ,sample); - const char *errno_text; - switch (errno) { - case ENOSYS: - errno_text = "ENOSYS"; - break; - case EPERM: - errno_text = "EPERM"; - break; - default: - errno_text = "ENOENT"; - } - printf("chroot(\"%s\") = %d %s (%m)\n", - sample, rc, errno_text); + + long rc = syscall(__NR_chroot, sample); + printf("chroot(\"%s\") = %ld %s (%m)\n", + sample, rc, errno2name()); puts("+++ exited with 0 +++"); return 0;