summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 42cb240260f..876b1063802 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.505.2.4 2007/07/19 19:14:25 adunstan Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.505.2.5 2007/08/02 23:17:20 adunstan Exp $
*
* NOTES
*
@@ -3272,6 +3272,15 @@ SubPostmasterMain(int argc, char *argv[])
MyProcPid = getpid(); /* reset MyProcPid */
+ /* make sure stderr is in binary mode before anything can
+ * possibly be written to it, in case it's actually the syslogger pipe,
+ * so the pipe chunking protocol isn't disturbed. Non-logpipe data
+ * gets translated on redirection (e.g. via pg_ctl -l) anyway.
+ */
+#ifdef WIN32
+ _setmode(fileno(stderr),_O_BINARY);
+#endif
+
/* Lose the postmaster's on-exit routines (really a no-op) */
on_exit_reset();