Fix unportable setvbuf() usage in initdb.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 15 May 2014 19:57:57 +0000 (15:57 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 15 May 2014 19:57:57 +0000 (15:57 -0400)
commit8960b2db5151575099da7cadff10e3316af8c16b
tree819fef2f6a89fb1042a3982fdd3b18c307b92c4b
parent19d7e8f07abf6b3a2e3d7c0c9c51041dfaac0ad6
Fix unportable setvbuf() usage in initdb.

In yesterday's commit 2dc4f011fd61501cce507be78c39a2677690d44b, I tried
to force buffering of stdout/stderr in initdb to be what it is by
default when the program is run interactively on Unix (since that's how
most manual testing is done).  This tripped over the fact that Windows
doesn't support _IOLBF mode.  We dealt with that a long time ago in
syslogger.c by falling back to unbuffered mode on Windows.  Export that
solution in port.h and use it in initdb.

Back-patch to 8.4, like the previous commit.
src/backend/postmaster/syslogger.c
src/bin/initdb/initdb.c
src/include/port.h