From: Dmitry V. Levin Date: Thu, 21 Apr 2016 20:36:45 +0000 (+0000) Subject: tests/epoll_create1.c: cleanup X-Git-Tag: v4.12~359 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7529683349538b0e35d9eb149115ab93fb5625c1;p=strace tests/epoll_create1.c: cleanup * tests/epoll_create1.c (main): Use errno2name, stop using assert. --- diff --git a/tests/epoll_create1.c b/tests/epoll_create1.c index 270ab52c..bb86154f 100644 --- a/tests/epoll_create1.c +++ b/tests/epoll_create1.c @@ -39,18 +39,17 @@ int main(void) { - int rc = syscall(__NR_epoll_create1, O_CLOEXEC); + long rc = syscall(__NR_epoll_create1, O_CLOEXEC); if (rc == -1) { - if (ENOSYS != errno) - perror_msg_and_fail("epoll_create1 O_CLOEXEC"); - printf("epoll_create1(EPOLL_CLOEXEC) = -1 ENOSYS (%m)\n"); + printf("epoll_create1(EPOLL_CLOEXEC) = -1 %s (%m)\n", + errno2name()); } else { - printf("epoll_create1(EPOLL_CLOEXEC) = %d\n", rc); + printf("epoll_create1(EPOLL_CLOEXEC) = %ld\n", rc); } - assert(syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) == -1); - printf("epoll_create1(EPOLL_CLOEXEC|%#x) = -1 %s (%m)\n", - O_NONBLOCK, ENOSYS == errno ? "ENOSYS" : "EINVAL"); + rc = syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK); + printf("epoll_create1(EPOLL_CLOEXEC|%#x) = %ld %s (%m)\n", + O_NONBLOCK, rc, errno2name()); puts("+++ exited with 0 +++"); return 0;