From 37dc9b7b8828a3a6a00ca750dd1839452d044a50 Mon Sep 17 00:00:00 2001 From: ehouse Date: Mon, 6 Jul 2009 01:31:16 +0000 Subject: [PATCH] running under valgrind I need to handle SIGPIPE. --- xwords4/relay/xwrelay.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xwords4/relay/xwrelay.cpp b/xwords4/relay/xwrelay.cpp index c774eef3b..5c963787f 100644 --- a/xwords4/relay/xwrelay.cpp +++ b/xwords4/relay/xwrelay.cpp @@ -548,6 +548,12 @@ parentDied( int sig ) exit(0); } +static void +handlePipe( int sig ) +{ + logf( XW_LOGINFO, "%s", __func__ ); +} + int main( int argc, char** argv ) { @@ -710,6 +716,10 @@ main( int argc, char** argv ) sact.sa_handler = parentDied; (void)sigaction( SIGUSR1, &sact, NULL ); + memset( &sact, 0, sizeof(sact) ); + sact.sa_handler = handlePipe; + (void)sigaction( SIGPIPE, &sact, NULL ); + if ( port != 0 ) { g_listeners.AddListener( port ); }