postgres.git / summary / log / commit / refs
commit 9fc69f5a67d92aa39142851c3d32c658e3a3ee09
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun Nov 29 01:52:32 1998 +0000
First released in: 6.5, 6.4.2
Portability fix for old SunOS releases: fflush(NULL)
doesn't work there. Fortunately the postmaster only has stdout and
stderr to flush.
src/backend/postmaster/postmaster.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 07e5060f309..7be367926bf 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.97 1998/09/01 04:31:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.97.2.1 1998/11/29 01:52:32 tgl Exp $
*
* NOTES
*
@@ -1289,10 +1289,14 @@ BackendStartup(Port *port)
}
/*
- * Flush all stdio channels just before fork, to avoid double-output
- * problems.
+ * Flush stdio channels just before fork, to avoid double-output problems.
+ * Ideally we'd use fflush(NULL) here, but there are still a few non-ANSI
+ * stdio libraries out there (like SunOS 4.1.x) that coredump if we do.
+ * Presently stdout and stderr are the only stdio output channels used
+ * by the postmaster, so fflush'ing them should be sufficient.
*/
- fflush(NULL);
+ fflush(stdout);
+ fflush(stderr);
if ((pid = fork()) == 0)
{ /* child */
[parent: 932dbd1c30d5]