diff options
-rw-r--r-- | src/Sockets.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index 8e621ff..160e6b6 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -14,6 +14,8 @@ #include <stdio.h> #include <stdlib.h> +#include <signal.h> + #ifdef HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ @@ -164,6 +166,14 @@ int HTTP_SetupServer(int port, int queue_size, int hunt) FD_ZERO (&active_fd_set); FD_SET (sock, &active_fd_set); + /* Not all architectures support the MSG_NOSIGNAL flag to send and recv, + * so setup to ignore the SIGPIPE via normal signal hadnling as well. + */ + +#ifdef SIGPIPE + signal(SIGPIPE,SIG_IGN); +#endif + return 0; } |