commit de395db8e3064919bbeaeb8344bf84f9566fb48b from: Alexander Barton date: Fri Jun 24 19:55:10 2005 UTC Get rid of Log_SetDaemonized(). commit - dbea1873731f7a0bd718b6f84b75faa10b83fe66 commit + de395db8e3064919bbeaeb8344bf84f9566fb48b blob - 8e295df6596f90717e0a305994b5646d5adc32e2 blob + 459ba1d296da77d5addfe58e93d7e0153e52a518 --- src/ngircd/log.c +++ src/ngircd/log.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: log.c,v 1.56 2005/06/24 19:20:56 fw Exp $"; +static char UNUSED id[] = "$Id: log.c,v 1.57 2005/06/24 19:55:10 alex Exp $"; #include "imp.h" #include @@ -45,19 +45,21 @@ static char UNUSED id[] = "$Id: log.c,v 1.56 2005/06/2 LOCAL char Init_Txt[127]; +LOCAL bool Is_Daemon; #ifdef DEBUG LOCAL char Error_File[FNAME_LEN]; #endif -LOCAL Is_Daemon; + LOCAL void Wall_ServerNotice PARAMS(( char *Msg )); -GLOBAL void Log_SetDaemonized(void) { Is_Daemon = true; } GLOBAL void -Log_Init( void ) +Log_Init( bool Daemon_Mode ) { + Is_Daemon = Daemon_Mode; + #ifdef SYSLOG #ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS/LOG_LOCAL5 */ #define LOG_CONS 0 blob - 2dfc4c484764807bdaf293e53d7dde57b8e4b456 blob + a49375f4f51c089678424af3a26d94885cd92168 --- src/ngircd/log.h +++ src/ngircd/log.h @@ -8,7 +8,7 @@ * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: log.h,v 1.17 2005/06/24 19:20:56 fw Exp $ + * $Id: log.h,v 1.18 2005/06/24 19:55:10 alex Exp $ * * Logging functions (header) */ @@ -35,21 +35,20 @@ #define LOG_snotice 1024 -GLOBAL void Log_Init PARAMS((void )); -GLOBAL void Log_Exit PARAMS((void )); +GLOBAL void Log_Init PARAMS(( bool Daemon_Mode )); +GLOBAL void Log_Exit PARAMS(( void )); -GLOBAL void Log PARAMS((int Level, const char *Format, ... )); +GLOBAL void Log PARAMS(( int Level, const char *Format, ... )); -GLOBAL void Log_Init_Resolver PARAMS((void )); -GLOBAL void Log_Exit_Resolver PARAMS((void )); +GLOBAL void Log_Init_Resolver PARAMS(( void )); +GLOBAL void Log_Exit_Resolver PARAMS(( void )); -GLOBAL void Log_Resolver PARAMS((const int Level, const char *Format, ... )); +GLOBAL void Log_Resolver PARAMS(( const int Level, const char *Format, ... )); #ifdef DEBUG -GLOBAL void Log_InitErrorfile PARAMS((void )); +GLOBAL void Log_InitErrorfile PARAMS(( void )); #endif -GLOBAL void Log_SetDaemonized PARAMS((void)); #endif blob - ab289fd5cf685ca2c04666ca2fdc1cca97cc13a7 blob + f435c712d9bda13b8aab013516da80e4db6979d1 --- src/ngircd/ngircd.c +++ src/ngircd/ngircd.c @@ -12,7 +12,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: ngircd.c,v 1.101 2005/06/24 19:20:56 fw Exp $"; +static char UNUSED id[] = "$Id: ngircd.c,v 1.102 2005/06/24 19:55:10 alex Exp $"; /** * @file @@ -259,7 +259,7 @@ main( int argc, const char *argv[] ) NGIRCd_SignalQuit = false; /* Initialize modules, part I */ - Log_Init( ); + Log_Init( ! NGIRCd_NoDaemon ); Conf_Init( ); if (!NGIRCd_Init( NGIRCd_NoDaemon )) { @@ -742,8 +742,6 @@ NGIRCd_Init( bool NGIRCd_NoDaemon ) * connected to ther controlling terminal. Use "--nodaemon" * to disable this "daemon mode" (useful for debugging). */ if ( ! NGIRCd_NoDaemon ) { - initialized = true; - Log_SetDaemonized(); pid = (long)fork( ); if( pid > 0 ) { /* "Old" process: exit. */