tools: Ignore SIGPIPE
diff --git a/tools/icat.c b/tools/icat.c
index 42f7420..b306a47 100644
--- a/tools/icat.c
+++ b/tools/icat.c
@@ -36,6 +36,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/ioctl.h>
+#include <signal.h>
 #endif
 
 #include "usbmuxd.h"
@@ -86,6 +87,9 @@
         return -EINVAL;
     }
 
+#ifndef WIN32
+    signal(SIGPIPE, SIG_IGN);
+#endif
     usbmuxd_device_info_t *dev_list = NULL;
     int count;
     if ((count = usbmuxd_get_device_list(&dev_list)) < 0) {
diff --git a/tools/iproxy.c b/tools/iproxy.c
index a018cf7..0a9ca54 100644
--- a/tools/iproxy.c
+++ b/tools/iproxy.c
@@ -40,6 +40,7 @@
 #include <arpa/inet.h>
 #include <pthread.h>
 #include <netinet/in.h>
+#include <signal.h>
 #endif
 #include "socket.h"
 #include "usbmuxd.h"
@@ -277,6 +278,9 @@
 		return -EINVAL;
 	}
 
+#ifndef WIN32
+	signal(SIGPIPE, SIG_IGN);
+#endif
 	// first create the listening socket endpoint waiting for connections.
 	mysock = socket_create(listen_port);
 	if (mysock < 0) {