$NetBSD$

--- src/main.c.orig	2004-10-25 01:32:51.000000000 +0000
+++ src/main.c
@@ -28,6 +28,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
+#include <signal.h>
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -233,6 +234,12 @@ SetupEnvironment(WScreen *scr)
 {
     char *tmp, *ptr;
     char buf[16];
+    struct sigaction sa;
+
+    sa.sa_handler = SIG_DFL;
+    sigemptyset(&sa.sa_mask);
+    /* sa.sa_mask = 0; */
+    sigaction(SIGPIPE, &sa, NULL);
 
     if (multiHead) {
         int len = strlen(DisplayName)+64;
