From b52a49d7b02a07a496573ea3348a4b5f613125f4 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 19 Mar 2011 16:50:18 -0700 Subject: [PATCH] Ignore SIGPIPE (force checking of EPIPE instead). --- guacd/src/daemon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guacd/src/daemon.c b/guacd/src/daemon.c index 4364eeeb..ef21908e 100644 --- a/guacd/src/daemon.c +++ b/guacd/src/daemon.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #ifdef __MINGW32__ @@ -103,7 +104,6 @@ void* start_client_thread(void* data) { } guac_start_client(client); - guac_free_client(client); /* Close socket */ @@ -235,6 +235,11 @@ int main(int argc, char* argv[]) { /* Otherwise, this is the daemon */ GUAC_LOG_INFO("Started, listening on port %i", listen_port); + /* Ignore SIGPIPE */ + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { + GUAC_LOG_ERROR("Could not set handler for SIGPIPE to ignore. SIGPIPE will cause termination of the daemon."); + } + /* Daemon loop */ for (;;) {