summaryrefslogtreecommitdiff
path: root/src/bin/initdb
diff options
context:
space:
mode:
authorTom Lane2014-05-15 19:57:54 +0000
committerTom Lane2014-05-15 19:57:54 +0000
commitf62d417825d6a8e26768a130a5f4c9e454d9dbe4 (patch)
tree2bcb47f506363428363a7015b78714e21cc0970d /src/bin/initdb
parent2f8e68bd7ea3523977567369056c4b3e67e44fdc (diff)
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.
Diffstat (limited to 'src/bin/initdb')
-rw-r--r--src/bin/initdb/initdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index acaae029806..5228f134222 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -3529,7 +3529,7 @@ main(int argc, char *argv[])
* unexpected output ordering when, eg, output is redirected to a file.
* POSIX says we must do this before any other usage of these files.
*/
- setvbuf(stdout, NULL, _IOLBF, 0);
+ setvbuf(stdout, NULL, PG_IOLBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
progname = get_progname(argv[0]);