From: Dmitry V. Levin Date: Wed, 6 Jan 2016 09:50:44 +0000 (+0000) Subject: tests/timer_xettime.c: use libtests X-Git-Tag: v4.12~715 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0566d548f98918222e86bbf8dcb6c1837cd5334b;p=strace tests/timer_xettime.c: use libtests * tests/timer_xettime.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- diff --git a/tests/timer_xettime.c b/tests/timer_xettime.c index 9e12bfe7..189b76cb 100644 --- a/tests/timer_xettime.c +++ b/tests/timer_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,17 +26,18 @@ */ #include "tests.h" -#include -#include -#include -#include -#include #include #if defined __NR_timer_create \ && defined __NR_timer_gettime \ && defined __NR_timer_settime +# include +# include +# include +# include +# include + int main(void) { @@ -44,7 +45,7 @@ main(void) struct sigevent sev = { .sigev_notify = SIGEV_NONE }; if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid)) - return 77; + perror_msg_and_skip("timer_create"); printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); @@ -62,7 +63,7 @@ main(void) }; if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) - return 77; + perror_msg_and_skip("timer_settime"); printf("timer_settime(%d, 0" ", {it_interval={%jd, %jd}, it_value={%jd, %jd}}" ", {it_interval={%jd, %jd}, it_value={%jd, %jd}}" @@ -78,7 +79,7 @@ main(void) (intmax_t) old.its.it_value.tv_nsec); if (syscall(__NR_timer_gettime, tid, &old.its)) - return 77; + perror_msg_and_skip("timer_gettime"); printf("timer_gettime(%d" ", {it_interval={%jd, %jd}, it_value={%jd, %jd}}" ") = 0\n", @@ -94,10 +95,6 @@ main(void) #else -int -main(void) -{ - return 77; -} +SKIP_MAIN_UNDEFINED("__NR_timer_create && __NR_timer_gettime && __NR_timer_settime") #endif