3939#include "pgstat.h"
4040#include "pgtime.h"
4141#include "postmaster/fork_process.h"
42+ #include "postmaster/interrupt.h"
4243#include "postmaster/postmaster.h"
4344#include "postmaster/syslogger.h"
4445#include "storage/dsm.h"
@@ -123,7 +124,6 @@ static CRITICAL_SECTION sysloggerSection;
123124/*
124125 * Flags set by interrupt handlers for later service in the main loop.
125126 */
126- static volatile sig_atomic_t got_SIGHUP = false;
127127static volatile sig_atomic_t rotation_requested = false;
128128
129129
@@ -144,7 +144,6 @@ static unsigned int __stdcall pipeThread(void *arg);
144144static void logfile_rotate (bool time_based_rotation , int size_rotation_for );
145145static char * logfile_getname (pg_time_t timestamp , const char * suffix );
146146static void set_next_rotation_time (void );
147- static void sigHupHandler (SIGNAL_ARGS );
148147static void sigUsr1Handler (SIGNAL_ARGS );
149148static void update_metainfo_datafile (void );
150149
@@ -240,7 +239,7 @@ SysLoggerMain(int argc, char *argv[])
240239 * broken backends...
241240 */
242241
243- pqsignal (SIGHUP , sigHupHandler ); /* set flag to read config file */
242+ pqsignal (SIGHUP , SignalHandlerForConfigReload ); /* set flag to read config file */
244243 pqsignal (SIGINT , SIG_IGN );
245244 pqsignal (SIGTERM , SIG_IGN );
246245 pqsignal (SIGQUIT , SIG_IGN );
@@ -324,9 +323,9 @@ SysLoggerMain(int argc, char *argv[])
324323 /*
325324 * Process any requests or signals received recently.
326325 */
327- if (got_SIGHUP )
326+ if (ConfigReloadPending )
328327 {
329- got_SIGHUP = false;
328+ ConfigReloadPending = false;
330329 ProcessConfigFile (PGC_SIGHUP );
331330
332331 /*
@@ -1553,18 +1552,6 @@ RemoveLogrotateSignalFiles(void)
15531552 unlink (LOGROTATE_SIGNAL_FILE );
15541553}
15551554
1556- /* SIGHUP: set flag to reload config file */
1557- static void
1558- sigHupHandler (SIGNAL_ARGS )
1559- {
1560- int save_errno = errno ;
1561-
1562- got_SIGHUP = true;
1563- SetLatch (MyLatch );
1564-
1565- errno = save_errno ;
1566- }
1567-
15681555/* SIGUSR1: set flag to rotate logfile */
15691556static void
15701557sigUsr1Handler (SIGNAL_ARGS )
0 commit comments