mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Make sure syslogPipe runs in binary mode on Windows to avoid corrupting the pipe chunking protocol. Backport to 8.0
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.535 2007/07/24 04:54:09 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.536 2007/08/02 23:15:26 adunstan Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@ -3385,6 +3385,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();
|
||||
|
||||
|
Reference in New Issue
Block a user