tests/oldselect.c: use libtests
* tests/oldselect.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_fail and perror_msg_and_skip.
This commit is contained in:
parent
1bda9d71b2
commit
fc3e11bcdc
@ -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 @@ 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user