diff options
author | Andrei Vagin <avagin@gmail.com> | 2018-11-27 20:45:41 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2019-04-21 06:25:26 +0300 |
commit | f046de70e51d570a093acc8608cc1218500e401b (patch) | |
tree | eb977f759d1a8ae194fadb6897a1cf0a675a2f24 /test | |
parent | 5be76840706f6830d6d3f2712ff351167a4b9e90 (diff) |
socket-tcp: ignore SIGPIPE
The test is trying to write into a closed socket and the kernel sends
SIGPIPE in this case, which is perfectly normal and should not fail the
test.
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/zdtm/static/socket-tcp-closed.c | 2 | ||||
-rw-r--r-- | test/zdtm/static/socket-tcp-reseted.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/test/zdtm/static/socket-tcp-closed.c b/test/zdtm/static/socket-tcp-closed.c index 0447e95b2..a51f9b96d 100644 --- a/test/zdtm/static/socket-tcp-closed.c +++ b/test/zdtm/static/socket-tcp-closed.c @@ -23,6 +23,7 @@ const char *test_author = "Andrey Vagin <avagin@openvz.org"; #include <signal.h> #include <netinet/tcp.h> #include <arpa/inet.h> +#include <signal.h> static int port = 8880; @@ -43,6 +44,7 @@ int main(int argc, char **argv) #endif test_init(argc, argv); + signal(SIGPIPE, SIG_IGN); sk = socket(ZDTM_FAMILY, SOCK_STREAM, 0); if (sk < 0) { diff --git a/test/zdtm/static/socket-tcp-reseted.c b/test/zdtm/static/socket-tcp-reseted.c index ce52e1148..07ad36009 100644 --- a/test/zdtm/static/socket-tcp-reseted.c +++ b/test/zdtm/static/socket-tcp-reseted.c @@ -5,6 +5,7 @@ #include <arpa/inet.h> /* for sockaddr_in and inet_ntoa() */ #include <stdlib.h> #include <sys/wait.h> +#include <signal.h> #ifdef ZDTM_IPV4V6 #define ZDTM_FAMILY AF_INET @@ -38,6 +39,7 @@ int main(int argc, char **argv) char cmd[4096], buf[10]; test_init(argc, argv); + signal(SIGPIPE, SIG_IGN); if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) { pr_err("initializing server failed\n"); |