Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02d3322

Browse files
committed
Use standard SIGHUP handler in syslogger.
Commit1e53fe0 changed background processes so that they usestandard SIGHUP handler. Like that, this commit makes syslogger usestandard SIGHUP handler to simplify the code.Author: Bharath RupireddyReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/CALj2ACXPorUqePswDtOeM_s82v9RW32E1fYmOPZ5NuE+TWKj_A@mail.gmail.com
1 parent9f12a3b commit02d3322

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

‎src/backend/postmaster/syslogger.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
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-
staticvolatilesig_atomic_tgot_SIGHUP= false;
127127
staticvolatilesig_atomic_trotation_requested= false;
128128

129129

@@ -144,7 +144,6 @@ static unsigned int __stdcall pipeThread(void *arg);
144144
staticvoidlogfile_rotate(booltime_based_rotation,intsize_rotation_for);
145145
staticchar*logfile_getname(pg_time_ttimestamp,constchar*suffix);
146146
staticvoidset_next_rotation_time(void);
147-
staticvoidsigHupHandler(SIGNAL_ARGS);
148147
staticvoidsigUsr1Handler(SIGNAL_ARGS);
149148
staticvoidupdate_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-
staticvoid
1558-
sigHupHandler(SIGNAL_ARGS)
1559-
{
1560-
intsave_errno=errno;
1561-
1562-
got_SIGHUP= true;
1563-
SetLatch(MyLatch);
1564-
1565-
errno=save_errno;
1566-
}
1567-
15681555
/* SIGUSR1: set flag to rotate logfile */
15691556
staticvoid
15701557
sigUsr1Handler(SIGNAL_ARGS)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp