diff options
Diffstat (limited to 'cfws.c')
-rw-r--r-- | cfws.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,3 +1,4 @@ +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -18,6 +19,10 @@ int main(int argc, char *argv[]) int serverfd, clientfd; struct http_request request; + /* Prevent the program from quitting if it attempts to write to a closed + * socket. */ + signal(SIGPIPE, SIG_IGN); + serverfd = net_init_server(port); if (serverfd == -1) return 1; |