39
39
#include "pgstat.h"
40
40
#include "pgtime.h"
41
41
#include "postmaster/fork_process.h"
42
+ #include "postmaster/interrupt.h"
42
43
#include "postmaster/postmaster.h"
43
44
#include "postmaster/syslogger.h"
44
45
#include "storage/dsm.h"
@@ -123,7 +124,6 @@ static CRITICAL_SECTION sysloggerSection;
123
124
/*
124
125
* Flags set by interrupt handlers for later service in the main loop.
125
126
*/
126
- static volatile sig_atomic_t got_SIGHUP = false;
127
127
static volatile sig_atomic_t rotation_requested = false;
128
128
129
129
@@ -144,7 +144,6 @@ static unsigned int __stdcall pipeThread(void *arg);
144
144
static void logfile_rotate (bool time_based_rotation , int size_rotation_for );
145
145
static char * logfile_getname (pg_time_t timestamp , const char * suffix );
146
146
static void set_next_rotation_time (void );
147
- static void sigHupHandler (SIGNAL_ARGS );
148
147
static void sigUsr1Handler (SIGNAL_ARGS );
149
148
static void update_metainfo_datafile (void );
150
149
@@ -240,7 +239,7 @@ SysLoggerMain(int argc, char *argv[])
240
239
* broken backends...
241
240
*/
242
241
243
- pqsignal (SIGHUP , sigHupHandler ); /* set flag to read config file */
242
+ pqsignal (SIGHUP , SignalHandlerForConfigReload ); /* set flag to read config file */
244
243
pqsignal (SIGINT , SIG_IGN );
245
244
pqsignal (SIGTERM , SIG_IGN );
246
245
pqsignal (SIGQUIT , SIG_IGN );
@@ -324,9 +323,9 @@ SysLoggerMain(int argc, char *argv[])
324
323
/*
325
324
* Process any requests or signals received recently.
326
325
*/
327
- if (got_SIGHUP )
326
+ if (ConfigReloadPending )
328
327
{
329
- got_SIGHUP = false;
328
+ ConfigReloadPending = false;
330
329
ProcessConfigFile (PGC_SIGHUP );
331
330
332
331
/*
@@ -1553,18 +1552,6 @@ RemoveLogrotateSignalFiles(void)
1553
1552
unlink (LOGROTATE_SIGNAL_FILE );
1554
1553
}
1555
1554
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
-
1568
1555
/* SIGUSR1: set flag to rotate logfile */
1569
1556
static void
1570
1557
sigUsr1Handler (SIGNAL_ARGS )
0 commit comments