Module: ngircd.git Branch: master Commit: 3beb2880396722f79becaf3da9c6b034fb57e1c3 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=3beb2...
Author: Florian Westphal fw@strlen.de Date: Tue Sep 14 23:36:33 2010 +0200
Fix signalpipe file descriptor leak on RESTART
Signals_Init() must only be called once. This does not affect any ngircd release version.
---
src/ngircd/ngircd.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index d4d4d5f..0d0a757 100644 --- a/src/ngircd/ngircd.c +++ b/src/ngircd/ngircd.c @@ -255,7 +255,17 @@ main( int argc, const char *argv[] ) Show_Version( ); puts( "" ); exit( Conf_Test( )); } - + + if (!io_library_init(CONNECTION_POOL)) { + Log(LOG_ALERT, "Fatal: Cannot initialize IO routines: %s", strerror(errno)); + exit(1); + } + + if (!Signals_Init()) { + Log(LOG_ALERT, "Fatal: Could not set up signal handlers: %s", strerror(errno)); + exit(1); + } + while( ! NGIRCd_SignalQuit ) { /* Initialize global variables */ @@ -290,15 +300,6 @@ main( int argc, const char *argv[] ) * when not running in "no daemon" mode: */ if( ! NGIRCd_NoDaemon ) Log_InitErrorfile( ); #endif - if (!io_library_init(CONNECTION_POOL)) { - Log(LOG_ALERT, "Fatal: Cannot initialize IO routines: %s", strerror(errno)); - exit(1); - } - - if (!Signals_Init()) { - Log(LOG_ALERT, "Fatal: Could not set up signal handlers: %s", strerror(errno)); - exit(1); - }
/* * create protocol and server identification.