summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2004-01-21 01:17:47 +0000
committerdscho <dscho>2004-01-21 01:17:47 +0000
commitd58d3af1ce091dfeba4d6ed3a2ad5e629678ead5 (patch)
treeb6d3916c8897a1b4eead2bb013e9d3a33454626a
parentc4a0223e389e9d570acea8e8ddec6a658ba8c7d4 (diff)
downloadlibtdevnc-d58d3af1ce091dfeba4d6ed3a2ad5e629678ead5.tar.gz
libtdevnc-d58d3af1ce091dfeba4d6ed3a2ad5e629678ead5.zip
ignore SIGPIPE by default; it is handled via EPIPE
-rw-r--r--main.c6
-rw-r--r--rfb/rfb.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index e394a48..6eded98 100644
--- a/main.c
+++ b/main.c
@@ -638,6 +638,8 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
/* initialize client list and iterator mutex */
rfbClientListInit(rfbScreen);
+ rfbScreen->ignoreSIGPIPE = TRUE;
+
return(rfbScreen);
}
@@ -747,6 +749,8 @@ void rfbScreenCleanup(rfbScreenInfoPtr rfbScreen)
#endif
}
+static void ignoreSignal(int dummy) {}
+
void rfbInitServer(rfbScreenInfoPtr rfbScreen)
{
#ifdef WIN32
@@ -755,6 +759,8 @@ void rfbInitServer(rfbScreenInfoPtr rfbScreen)
#endif
rfbInitSockets(rfbScreen);
httpInitSockets(rfbScreen);
+ if(rfbScreen->ignoreSIGPIPE)
+ signal(SIGPIPE,ignoreSignal);
}
#ifndef LIBVNCSERVER_HAVE_GETTIMEOFDAY
diff --git a/rfb/rfb.h b/rfb/rfb.h
index f56e692..a571235 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -274,6 +274,7 @@ typedef struct _rfbScreenInfo
rfbBool backgroundLoop;
#endif
+ rfbBool ignoreSIGPIPE;
} rfbScreenInfo, *rfbScreenInfoPtr;