From 66172041078f257d947d8a522b94af2687218b95 Mon Sep 17 00:00:00 2001 From: goodale Date: Tue, 31 Oct 2000 17:17:13 +0000 Subject: Using a signal handler to ignore SIGPIPE as not all architectures support the MSG_NOSIGNAL flag to send and recv. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@99 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Sockets.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Sockets.c') 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 #include +#include + #ifdef HAVE_UNISTD_H #include #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; } -- cgit v1.2.3