mirror of
https://github.com/samhocevar/rinetd.git
synced 2025-04-26 04:50:21 +08:00
Group all signal handlers together.
This commit is contained in:
parent
e69b28d9a0
commit
54cf9badb2
20
rinetd.c
20
rinetd.c
@ -1211,6 +1211,7 @@ RETSIGTYPE plumber(int s)
|
||||
|
||||
RETSIGTYPE hup(int s)
|
||||
{
|
||||
(void)s;
|
||||
syslog(LOG_INFO, "Received SIGHUP, reloading configuration...");
|
||||
/* Learn the new rules */
|
||||
readConfiguration();
|
||||
@ -1221,6 +1222,16 @@ RETSIGTYPE hup(int s)
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
||||
RETSIGTYPE term(int s)
|
||||
{
|
||||
(void)s;
|
||||
/* Obey the request, but first flush the log */
|
||||
if (logFile) {
|
||||
fclose(logFile);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void RegisterPID(void)
|
||||
{
|
||||
FILE *pid_file;
|
||||
@ -1421,12 +1432,3 @@ void refuse(ConnectionInfo *cnx, int logCode)
|
||||
logEvent(cnx, cnx->server, logCode);
|
||||
}
|
||||
|
||||
RETSIGTYPE term(int s)
|
||||
{
|
||||
/* Obey the request, but first flush the log */
|
||||
if (logFile) {
|
||||
fclose(logFile);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user