From 0484d65581c1aae4de04fd1868057d8be4025285 Mon Sep 17 00:00:00 2001 From: seife Date: Fri, 4 Mar 2011 14:11:21 +0000 Subject: [PATCH] neutrino: don't crap your pants on SIGPIPE A SIGPIPE can happen e.g. in streamts.cpp. Dont die, but just ignore the signal. Should fix bug#375. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1238 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/neutrino.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 371c70185..e3c0fb05f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4498,9 +4498,11 @@ void sighandler (int signum) int main(int argc, char **argv) { setDebugLevel(DEBUG_NORMAL); - signal(SIGTERM, sighandler); - signal(SIGINT, sighandler); - signal(SIGHUP, SIG_IGN); + signal(SIGTERM, sighandler); // TODO: consider the following + signal(SIGINT, sighandler); // NOTES: The effects of signal() in a multithreaded + signal(SIGHUP, SIG_IGN); // process are unspecified (signal(2)) + /* don't die in streamts.cpp from a SIGPIPE if client disconnects */ + signal(SIGPIPE, SIG_IGN); for(int i = 3; i < 256; i++) close(i);