Group all signal handlers together.

This commit is contained in:
Sam Hocevar 2016-01-12 11:46:31 +01:00
parent e69b28d9a0
commit 54cf9badb2

View File

@ -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);
}