Commit 533bd1d5 authored by Tom Lane's avatar Tom Lane

Add _O_TEXT option to dup2 call on Windows, to ensure redirected postmaster

stderr is in text mode.  Per Andreas.
parent 8ae7278c
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.2 2004/08/06 16:00:51 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.3 2004/08/06 16:06:59 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -495,7 +495,8 @@ SysLogger_Start(void) ...@@ -495,7 +495,8 @@ SysLogger_Start(void)
syslogPipe[1] = -1; syslogPipe[1] = -1;
#else #else
fflush(stderr); fflush(stderr);
if (dup2(_open_osfhandle((long)syslogPipe[1], _O_APPEND), if (dup2(_open_osfhandle((long)syslogPipe[1],
_O_APPEND | _O_TEXT),
_fileno(stderr)) < 0) _fileno(stderr)) < 0)
ereport(FATAL, ereport(FATAL,
(errcode_for_file_access(), (errcode_for_file_access(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment