summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2007-07-19 19:15:25 +0000
committerAndrew Dunstan <andrew@dunslane.net>2007-07-19 19:15:25 +0000
commit19c9660ca8e87cee53d80dc4e2c19b4530c44264 (patch)
tree2dfda435db854c4e56f76ec0f10ea5985f57830b /src/backend/postmaster/postmaster.c
parenta41c4b218fc7a67234fa657a0b611fea70ddd394 (diff)
Only use the pipe chunking protocol if we know the syslogger should
be catching stderr output, and we are not ourselves the syslogger. Otherwise, go directly to stderr. Bug noticed by Tom Lane. Backpatch as far as 8.0.
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 69a2b5bbcf7..afe953cd6d4 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.443.4.8 2006/07/16 18:17:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.443.4.9 2007/07/19 19:15:25 adunstan Exp $
*
* NOTES
*
@@ -221,6 +221,7 @@ static bool FatalError = false; /* T if recovering from backend crash */
bool ClientAuthInProgress = false; /* T during new-client
* authentication */
+bool redirection_done = false;
/*
* State for assigning random salts and cancel keys.
@@ -330,6 +331,7 @@ typedef struct
InheritableSocket pgStatPipe0;
InheritableSocket pgStatPipe1;
pid_t PostmasterPid;
+ bool redirection_done;
#ifdef WIN32
HANDLE PostmasterHandle;
HANDLE initial_signal_pipe;
@@ -3718,6 +3720,8 @@ save_backend_variables(BackendParameters *param, Port *port,
param->PostmasterPid = PostmasterPid;
+ param->redirection_done = redirection_done;
+
#ifdef WIN32
param->PostmasterHandle = PostmasterHandle;
write_duplicated_handle(&param->initial_signal_pipe,
@@ -3920,6 +3924,8 @@ restore_backend_variables(BackendParameters *param, Port *port)
PostmasterPid = param->PostmasterPid;
+ redirection_done = param->redirection_done;
+
#ifdef WIN32
PostmasterHandle = param->PostmasterHandle;
pgwin32_initial_signal_pipe = param->initial_signal_pipe;