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 9e12bfe..189b76c 100644
--- a/tests/timer_xettime.c
+++ b/tests/timer_xettime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,17 +26,18 @@
*/
#include "tests.h"
-#include <stdio.h>
-#include <stdint.h>
-#include <signal.h>
-#include <time.h>
-#include <unistd.h>
#include <sys/syscall.h>
#if defined __NR_timer_create \
&& defined __NR_timer_gettime \
&& defined __NR_timer_settime
+# include <stdio.h>
+# include <stdint.h>
+# include <signal.h>
+# include <time.h>
+# include <unistd.h>
+
int
main(void)
{
@@ -44,7 +45,7 @@
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 @@
};
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 @@
(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 @@
#else
-int
-main(void)
-{
- return 77;
-}
+SKIP_MAIN_UNDEFINED("__NR_timer_create && __NR_timer_gettime && __NR_timer_settime")
#endif