running under valgrind I need to handle SIGPIPE.

This commit is contained in:
ehouse 2009-07-06 01:31:16 +00:00
parent 7893c2066a
commit 37dc9b7b88

View file

@ -548,6 +548,12 @@ parentDied( int sig )
exit(0); exit(0);
} }
static void
handlePipe( int sig )
{
logf( XW_LOGINFO, "%s", __func__ );
}
int int
main( int argc, char** argv ) main( int argc, char** argv )
{ {
@ -710,6 +716,10 @@ main( int argc, char** argv )
sact.sa_handler = parentDied; sact.sa_handler = parentDied;
(void)sigaction( SIGUSR1, &sact, NULL ); (void)sigaction( SIGUSR1, &sact, NULL );
memset( &sact, 0, sizeof(sact) );
sact.sa_handler = handlePipe;
(void)sigaction( SIGPIPE, &sact, NULL );
if ( port != 0 ) { if ( port != 0 ) {
g_listeners.AddListener( port ); g_listeners.AddListener( port );
} }