tests/oldselect.c: use libtests
* tests/oldselect.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_fail and perror_msg_and_skip.
diff --git a/tests/oldselect.c b/tests/oldselect.c
index f2ed9ba..b8f265a 100644
--- a/tests/oldselect.c
+++ b/tests/oldselect.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,14 +26,15 @@
*/
#include "tests.h"
-#include <unistd.h>
-#include <sys/select.h>
#include <sys/syscall.h>
#if defined __NR_select && defined __NR__newselect \
&& __NR_select != __NR__newselect \
&& !defined SPARC
+# include <unistd.h>
+# include <sys/select.h>
+
int
main(void)
{
@@ -48,22 +49,18 @@
(void) close(0);
(void) close(1);
if (pipe(fds))
- return 77;
+ perror_msg_and_fail("pipe");
FD_SET(0, &w);
FD_SET(1, &r);
if (syscall(__NR_select, args))
- return 77;
+ perror_msg_and_skip("select");
return 0;
}
#else
-int
-main(void)
-{
- return 77;
-}
+SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect")
#endif