mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-07 14:20:29 +00:00
sighandlers.{c|h}: Code cleanup
- declare signals_catch[] array not between the function implementations. - rename now local function NGIRCd_Rehash() to Rehash(). - remove empty and therefore not used "catch SIGHUP; break;".
This commit is contained in:
parent
74578890b7
commit
b3cfbc3d28
@ -36,6 +36,10 @@
|
|||||||
|
|
||||||
static int signalpipe[2];
|
static int signalpipe[2];
|
||||||
|
|
||||||
|
static const int signals_catch[] = {
|
||||||
|
SIGINT, SIGQUIT, SIGTERM, SIGHUP, SIGCHLD, SIGUSR1, SIGUSR2
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
@ -86,11 +90,12 @@ Signal_Unblock(int sig)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reload the server configuration file.
|
* Reload the server configuration file.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
NGIRCd_Rehash( void )
|
Rehash(void)
|
||||||
{
|
{
|
||||||
char old_name[CLIENT_ID_LEN];
|
char old_name[CLIENT_ID_LEN];
|
||||||
unsigned old_nicklen;
|
unsigned old_nicklen;
|
||||||
@ -132,8 +137,7 @@ NGIRCd_Rehash( void )
|
|||||||
Conn_SyncServerStruct( );
|
Conn_SyncServerStruct( );
|
||||||
|
|
||||||
Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
|
Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
|
||||||
} /* NGIRCd_Rehash */
|
} /* Rehash */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -154,8 +158,6 @@ Signal_Handler(int Signal)
|
|||||||
/* shut down sever */
|
/* shut down sever */
|
||||||
NGIRCd_SignalQuit = true;
|
NGIRCd_SignalQuit = true;
|
||||||
return;
|
return;
|
||||||
case SIGHUP:
|
|
||||||
break;
|
|
||||||
case SIGCHLD:
|
case SIGCHLD:
|
||||||
/* child-process exited, avoid zombies */
|
/* child-process exited, avoid zombies */
|
||||||
while (waitpid( -1, NULL, WNOHANG) > 0)
|
while (waitpid( -1, NULL, WNOHANG) > 0)
|
||||||
@ -212,7 +214,7 @@ Signal_Handler_BH(int Signal)
|
|||||||
switch (Signal) {
|
switch (Signal) {
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
/* re-read configuration */
|
/* re-read configuration */
|
||||||
NGIRCd_Rehash();
|
Rehash();
|
||||||
break;
|
break;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
case SIGUSR2:
|
case SIGUSR2:
|
||||||
@ -252,7 +254,6 @@ Signal_Callback(int fd, short UNUSED what)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const int signals_catch[] = { SIGINT, SIGQUIT, SIGTERM, SIGHUP, SIGCHLD, SIGUSR1, SIGUSR2 };
|
|
||||||
/**
|
/**
|
||||||
* Initialize the signal handlers, catch
|
* Initialize the signal handlers, catch
|
||||||
* those signals we are interested in and sets SIGPIPE to be ignored.
|
* those signals we are interested in and sets SIGPIPE to be ignored.
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
* ngIRCd -- The Next Generation IRC Daemon
|
||||||
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
Loading…
Reference in New Issue
Block a user