diff util.c @ 1973:cd163b230cf9

Fix handling of remote disconnects
author Michael Pavone <pavone@retrodev.com>
date Fri, 08 May 2020 15:17:47 -0700
parents 417e0fc958cc
children 441d5d6cea2f
line wrap: on
line diff
--- a/util.c	Fri May 08 14:59:49 2020 -0700
+++ b/util.c	Fri May 08 15:17:47 2020 -0700
@@ -726,9 +726,14 @@
 
 #else
 #include <fcntl.h>
+#include <signal.h>
 
 void socket_init(void)
 {
+	//SIGPIPE on network sockets is not desired
+	//would be better to do this in a more limited way,
+	//but the alternatives are not portable
+	signal(SIGPIPE, SIG_IGN);
 }
 
 int socket_blocking(int sock, int should_block)