summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 6 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