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

Commitd90bd24

Browse files
committed
Remove am_syslogger global variable
Use the new MyBackendType instead. More similar changes for other "amsomething" variables are possible. This one was just particularlysimple.Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>Discussion:https://www.postgresql.org/message-id/flat/c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com
1 parent8e8a0be commitd90bd24

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

‎src/backend/postmaster/syslogger.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ char *Log_filename = NULL;
7474
boolLog_truncate_on_rotation= false;
7575
intLog_file_mode=S_IRUSR |S_IWUSR;
7676

77-
/*
78-
* Globally visible state (used by elog.c)
79-
*/
80-
boolam_syslogger= false;
81-
8277
externboolredirection_done;
8378

8479
/*
@@ -177,8 +172,6 @@ SysLoggerMain(int argc, char *argv[])
177172
syslogger_parseArgs(argc,argv);
178173
#endif/* EXEC_BACKEND */
179174

180-
am_syslogger= true;
181-
182175
MyBackendType=B_LOGGER;
183176
init_ps_display(NULL);
184177

@@ -1078,7 +1071,7 @@ flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer)
10781071
/*
10791072
* Write text to the currently open logfile
10801073
*
1081-
* This is exported so that elog.c can call it whenam_syslogger istrue.
1074+
* This is exported so that elog.c can call it whenMyBackendType isB_LOGGER.
10821075
* This allows the syslogger process to record elog messages of its own,
10831076
* even though its stderr does not point at the syslog pipe.
10841077
*/

‎src/backend/utils/error/elog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,7 +2923,7 @@ write_csvlog(ErrorData *edata)
29232923
appendStringInfoChar(&buf,'\n');
29242924

29252925
/* If in the syslogger process, try to write messages direct to file */
2926-
if (am_syslogger)
2926+
if (MyBackendType==B_LOGGER)
29272927
write_syslogger_file(buf.data,buf.len,LOG_DESTINATION_CSVLOG);
29282928
else
29292929
write_pipe_chunks(buf.data,buf.len,LOG_DESTINATION_CSVLOG);
@@ -3117,7 +3117,7 @@ send_message_to_server_log(ErrorData *edata)
31173117
* catching stderr output, and we are not ourselves the syslogger.
31183118
* Otherwise, just do a vanilla write to stderr.
31193119
*/
3120-
if (redirection_done&&!am_syslogger)
3120+
if (redirection_done&&MyBackendType!=B_LOGGER)
31213121
write_pipe_chunks(buf.data,buf.len,LOG_DESTINATION_STDERR);
31223122
#ifdefWIN32
31233123

@@ -3136,13 +3136,13 @@ send_message_to_server_log(ErrorData *edata)
31363136
}
31373137

31383138
/* If in the syslogger process, try to write messages direct to file */
3139-
if (am_syslogger)
3139+
if (MyBackendType==B_LOGGER)
31403140
write_syslogger_file(buf.data,buf.len,LOG_DESTINATION_STDERR);
31413141

31423142
/* Write to CSV log if enabled */
31433143
if (Log_destination&LOG_DESTINATION_CSVLOG)
31443144
{
3145-
if (redirection_done||am_syslogger)
3145+
if (redirection_done||MyBackendType==B_LOGGER)
31463146
{
31473147
/*
31483148
* send CSV data if it's safe to do so (syslogger doesn't need the

‎src/include/postmaster/syslogger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ extern PGDLLIMPORT char *Log_filename;
7070
externboolLog_truncate_on_rotation;
7171
externintLog_file_mode;
7272

73-
externboolam_syslogger;
74-
7573
#ifndefWIN32
7674
externintsyslogPipe[2];
7775
#else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp