|
From: Cyril H. <su...@li...> - 2013-04-30 11:21:21
|
The branch, master, has been updated
via 25f426417111b852555d2a0a61d94df2971a5726 (commit)
from be0fe25ec364aad44531171e6bd748d29272565c (commit)
- Log -----------------------------------------------------------------
commit 25f426417111b852555d2a0a61d94df2971a5726
Author: Cyril Hrubis <ch...@su...>
Date: Tue Apr 30 12:57:09 2013 +0200
syscalls/accept4: Fix test when accept4 returns ENOSYS
* Make the test actually exit with TCONF when accept4 returned ENOSYS
* Remove ifdefs around the main as due tu linux_syscall_numbers.h
both __NR_accept4 and __NR_socketcall are always defined.
Signed-off-by: Cyril Hrubis <ch...@su...>
-----------------------------------------------------------------------
Summary of changes:
testcases/kernel/syscalls/accept4/accept4_01.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
index 2629b1f..fa39236 100644
--- a/testcases/kernel/syscalls/accept4/accept4_01.c
+++ b/testcases/kernel/syscalls/accept4/accept4_01.c
@@ -138,8 +138,12 @@ do_test(int lfd, struct sockaddr_in *conn_addr,
closeonexec_flag | nonblock_flag);
#endif
if (acceptfd == -1) {
- tst_resm(TCONF,
- "syscall __NR_accept4 not supported on your arch");
+ if (errno == ENOSYS) {
+ tst_brkm(TCONF, cleanup,
+ "syscall __NR_accept4 not supported");
+ } else {
+ tst_brkm(TBROK | TERRNO, cleanup, "accept4 failed");
+ }
}
fdf = fcntl(acceptfd, F_GETFD);
@@ -209,7 +213,6 @@ static int create_listening_socket(int port_num)
int main(int argc, char *argv[])
{
-#if defined(__NR_accept4) || defined(__NR_socketcall)
struct sockaddr_in conn_addr;
int lfd;
int port_num;
@@ -228,11 +231,8 @@ int main(int argc, char *argv[])
do_test(lfd, &conn_addr, SOCK_CLOEXEC, 0);
do_test(lfd, &conn_addr, 0, SOCK_NONBLOCK);
do_test(lfd, &conn_addr, SOCK_CLOEXEC, SOCK_NONBLOCK);
+
close(lfd);
-#else
- tst_resm(TCONF, "syscall __NR_accept4 not supported on your arch");
-#endif
-
cleanup();
tst_exit();
}
hooks/post-receive
--
ltp
|