From 3a7c659e769680e81e789025b31539ca62b43265 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 6 Jan 2016 09:51:37 +0000 Subject: [PATCH] tests/timerfd_xettime.c: use libtests * tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- tests/timerfd_xettime.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/timerfd_xettime.c b/tests/timerfd_xettime.c index e8f40832..f97c1db9 100644 --- a/tests/timerfd_xettime.c +++ b/tests/timerfd_xettime.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,11 +26,7 @@ */ #include "tests.h" -#include -#include -#include #include -#include #include #if defined __NR_timerfd_create \ @@ -38,12 +34,17 @@ && defined __NR_timerfd_settime \ && defined O_CLOEXEC +# include +# include +# include +# include + int main(void) { (void) close(0); if (syscall(__NR_timerfd_create, CLOCK_MONOTONIC, O_CLOEXEC | O_NONBLOCK)) - return 77; + perror_msg_and_skip("timerfd_create"); puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); struct { @@ -60,7 +61,7 @@ main(void) }; if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) - return 77; + perror_msg_and_skip("timerfd_settime"); printf("timerfd_settime(0, 0" ", {it_interval={%jd, %jd}, it_value={%jd, %jd}}" ", {it_interval={%jd, %jd}, it_value={%jd, %jd}}" @@ -75,7 +76,7 @@ main(void) (intmax_t) old.its.it_value.tv_nsec); if (syscall(__NR_timerfd_gettime, 0, &old.its)) - return 77; + perror_msg_and_skip("timerfd_gettime"); printf("timerfd_gettime(0" ", {it_interval={%jd, %jd}, it_value={%jd, %jd}}" ") = 0\n", @@ -90,10 +91,7 @@ main(void) #else -int -main(void) -{ - return 77; -} +SKIP_MAIN_UNDEFINED("__NR_timerfd_create && __NR_timerfd_gettime" + " && __NR_timerfd_settime && O_CLOEXEC") #endif -- 2.40.0