From 19c9660ca8e87cee53d80dc4e2c19b4530c44264 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Thu, 19 Jul 2007 19:15:25 +0000 Subject: 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. --- src/backend/postmaster/postmaster.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/backend/postmaster/postmaster.c') 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(¶m->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; -- cgit v1.2.3