aboutsummaryrefslogtreecommitdiff
path: root/src/Sockets.c
diff options
context:
space:
mode:
authorgoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-10-31 17:17:13 +0000
committergoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-10-31 17:17:13 +0000
commit66172041078f257d947d8a522b94af2687218b95 (patch)
tree975031208709e9cd236f352ec0b368006e7eb46f /src/Sockets.c
parentaabd1d21d03b2265531a29b8b7b7e8382237dd86 (diff)
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
Diffstat (limited to 'src/Sockets.c')
-rw-r--r--src/Sockets.c10
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;
}