Commit f046de70 authored by Andrei Vagin's avatar Andrei Vagin

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: 's avatarAndrei Vagin <avagin@gmail.com>
parent 5be76840
...@@ -23,6 +23,7 @@ const char *test_author = "Andrey Vagin <avagin@openvz.org"; ...@@ -23,6 +23,7 @@ const char *test_author = "Andrey Vagin <avagin@openvz.org";
#include <signal.h> #include <signal.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <signal.h>
static int port = 8880; static int port = 8880;
...@@ -43,6 +44,7 @@ int main(int argc, char **argv) ...@@ -43,6 +44,7 @@ int main(int argc, char **argv)
#endif #endif
test_init(argc, argv); test_init(argc, argv);
signal(SIGPIPE, SIG_IGN);
sk = socket(ZDTM_FAMILY, SOCK_STREAM, 0); sk = socket(ZDTM_FAMILY, SOCK_STREAM, 0);
if (sk < 0) { if (sk < 0) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <arpa/inet.h> /* for sockaddr_in and inet_ntoa() */ #include <arpa/inet.h> /* for sockaddr_in and inet_ntoa() */
#include <stdlib.h> #include <stdlib.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <signal.h>
#ifdef ZDTM_IPV4V6 #ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET #define ZDTM_FAMILY AF_INET
...@@ -38,6 +39,7 @@ int main(int argc, char **argv) ...@@ -38,6 +39,7 @@ int main(int argc, char **argv)
char cmd[4096], buf[10]; char cmd[4096], buf[10];
test_init(argc, argv); test_init(argc, argv);
signal(SIGPIPE, SIG_IGN);
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) { if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n"); pr_err("initializing server failed\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment