diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2007-08-02 23:18:47 +0000 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2007-08-02 23:18:47 +0000 |
commit | 6c77d7d73b552a489fa262fbca926d6fadfa3fc8 (patch) | |
tree | d364fd1fab42e34e2c52f7afb8d7b2f86b787642 /src/backend/postmaster/postmaster.c | |
parent | cbf8f8282478b5d53bbe36977dea3f1dcf24ca42 (diff) |
Make sure syslogPipe runs in binary mode on Windows to avoid corrupting the pipe chunking protocol. Backport to 8.0
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 9bf5acbd5bc..8c54471586f 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.475.2.8 2007/07/19 19:14:54 adunstan Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.475.2.9 2007/08/02 23:18:47 adunstan Exp $ * * NOTES * @@ -3205,6 +3205,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 + /* In EXEC_BACKEND case we will not have inherited these settings */ IsPostmasterEnvironment = true; whereToSendOutput = DestNone; |