]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Get rid of Log_SetDaemonized().
authorAlexander Barton <alex@barton.de>
Fri, 24 Jun 2005 19:55:10 +0000 (19:55 +0000)
committerAlexander Barton <alex@barton.de>
Fri, 24 Jun 2005 19:55:10 +0000 (19:55 +0000)
src/ngircd/log.c
src/ngircd/log.h
src/ngircd/ngircd.c

index 8e295df6596f90717e0a305994b5646d5adc32e2..459ba1d296da77d5addfe58e93d7e0153e52a518 100644 (file)
@@ -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 <assert.h>
@@ -45,19 +45,21 @@ static char UNUSED id[] = "$Id: log.c,v 1.56 2005/06/24 19:20:56 fw Exp $";
 
 
 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
index 2dfc4c484764807bdaf293e53d7dde57b8e4b456..a49375f4f51c089678424af3a26d94885cd92168 100644 (file)
@@ -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)
  */
 #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
 
index ab289fd5cf685ca2c04666ca2fdc1cca97cc13a7..f435c712d9bda13b8aab013516da80e4db6979d1 100644 (file)
@@ -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. */