From: Dmitry V. Levin Date: Tue, 5 Jan 2016 23:11:48 +0000 (+0000) Subject: tests/epoll_create1.c: use libtests X-Git-Tag: v4.12~732 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69fe020a235e4fe16a564fcd6d07d94ab9ff20d1;p=strace tests/epoll_create1.c: use libtests * tests/epoll_create1.c: Use SKIP_MAIN_UNDEFINED. (main): Use assert and perror_msg_and_skip. --- diff --git a/tests/epoll_create1.c b/tests/epoll_create1.c index 6e5ef471..79196a4c 100644 --- a/tests/epoll_create1.c +++ b/tests/epoll_create1.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,19 +26,25 @@ */ #include "tests.h" +#include #include #include #include +#if defined __NR_epoll_create1 && defined O_CLOEXEC + int main(void) { -#if defined __NR_epoll_create1 && defined O_CLOEXEC (void) close(0); if (syscall(__NR_epoll_create1, O_CLOEXEC)) - return 77; - return syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) >= 0; + perror_msg_and_skip("epoll_create1 O_CLOEXEC"); + assert(syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) == -1); + return 0; +} + #else - return 77; + +SKIP_MAIN_UNDEFINED("__NR_epoll_create1 && O_CLOEXEC") + #endif -}