changeset 86:348c29b7d02a

fc-cmu200d: ignore SIGPIPE so we don't exit if a client terminates while we are processing a command
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 16 Jul 2017 23:42:29 +0000
parents 2bed7b024f64
children 34a1e06a8587
files cmu200/main.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cmu200/main.c	Sun Jul 16 00:00:46 2017 +0000
+++ b/cmu200/main.c	Sun Jul 16 23:42:29 2017 +0000
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <signal.h>
 
 int target_fd;
 
@@ -50,6 +51,7 @@
 	setlinebuf(stdout);	/* to allow logging with tee */
 	init_cmu200();
 	create_listener_socket();
+	signal(SIGPIPE, SIG_IGN);
 	for (;;) {
 		get_socket_connection();
 		handle_session();