mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-07 06:10:28 +00:00
- das Error-File wird nun komplett durch das Log-Modul verwaltet, der
Dateiname enthaelt nun die PID: so koennen mehrere Instanzen laufen.
This commit is contained in:
parent
f4b23bfc96
commit
1c00ddffec
@ -9,7 +9,7 @@
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: log.c,v 1.26 2002/03/27 21:03:09 alex Exp $
|
||||
* $Id: log.c,v 1.27 2002/03/29 20:59:22 alex Exp $
|
||||
*
|
||||
* log.c: Logging-Funktionen
|
||||
*/
|
||||
@ -39,6 +39,9 @@
|
||||
#include "log.h"
|
||||
|
||||
|
||||
LOCAL CHAR Error_File[FNAME_LEN];
|
||||
|
||||
|
||||
LOCAL VOID Wall_ServerNotice( CHAR *Msg );
|
||||
|
||||
|
||||
@ -83,8 +86,9 @@ GLOBAL VOID Log_Init( VOID )
|
||||
if( txt[0] ) Log( LOG_INFO, "Activating: %s.", txt );
|
||||
|
||||
/* stderr in Datei umlenken */
|
||||
sprintf( Error_File, ERROR_DIR"/"PACKAGE"-%ld.err", (INT32)getpid( ));
|
||||
fflush( stderr );
|
||||
if( ! freopen( ERROR_FILE, "a+", stderr )) Log( LOG_ERR, "Can't reopen stderr (\""ERROR_FILE"\"): %s", strerror( errno ));
|
||||
if( ! freopen( Error_File, "a+", stderr )) Log( LOG_ERR, "Can't reopen stderr (\"%s\"): %s", Error_File, strerror( errno ));
|
||||
|
||||
fprintf( stderr, "\n--- %s ---\n\n", NGIRCd_StartStr );
|
||||
fprintf( stderr, "%s started.\npid=%ld, ppid=%ld, uid=%ld, gid=%ld [euid=%ld, egid=%ld].\nActivating: %s\n\n", NGIRCd_Version( ), (INT32)getpid( ), (INT32)getppid( ), (INT32)getuid( ), (INT32)getgid( ), (INT32)geteuid( ), (INT32)getegid( ), txt[0] ? txt : "-" );
|
||||
@ -104,6 +108,9 @@ GLOBAL VOID Log_Exit( VOID )
|
||||
fprintf( stderr, PACKAGE" done (pid=%ld).\n", (INT32)getpid( ));
|
||||
fflush( stderr );
|
||||
|
||||
/* Error-File (stderr) loeschen */
|
||||
if( unlink( Error_File ) != 0 ) Log( LOG_ERR, "Can't delete \"%s\": %s", Error_File, strerror( errno ));
|
||||
|
||||
#ifdef USE_SYSLOG
|
||||
/* syslog abmelden */
|
||||
closelog( );
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: ngircd.c,v 1.37 2002/03/28 14:15:33 alex Exp $
|
||||
* $Id: ngircd.c,v 1.38 2002/03/29 20:59:22 alex Exp $
|
||||
*
|
||||
* ngircd.c: Hier beginnt alles ;-)
|
||||
*/
|
||||
@ -268,11 +268,6 @@ GLOBAL int main( int argc, const char *argv[] )
|
||||
Log_Exit( );
|
||||
}
|
||||
|
||||
#ifndef DEBUG
|
||||
/* aufraeumen */
|
||||
if( unlink( ERROR_FILE ) != 0 ) Log( LOG_ERR, "Can't delete \""ERROR_FILE"\": %s", strerror( errno ));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user