]> granicus.if.org Git - strace/commitdiff
tests/oldselect.c: use libtests
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 5 Jan 2016 22:53:28 +0000 (22:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 5 Jan 2016 22:53:28 +0000 (22:53 +0000)
* tests/oldselect.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_fail and perror_msg_and_skip.

tests/oldselect.c

index f2ed9ba7b7819a4a29aea280b39e73af8db49381..b8f265aaea3cd8de1ebdb60b77c024438f145945 100644 (file)
@@ -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
  */
 
 #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 @@ main(void)
        (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