Obsolete coding in fork_process.c - Mailing list pgsql-hackers

From Tom Lane
Subject Obsolete coding in fork_process.c
Date
Msg-id 30040.1398960808@sss.pgh.pa.us
Whole thread Raw
Responses Re: Obsolete coding in fork_process.c  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
fork_process.c quoth:
   /*    * 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.    *
Presentlystdout and stderr are the only stdio output channels used by    * the postmaster, so fflush'ing them should be
sufficient.   */   fflush(stdout);   fflush(stderr);
 

Is there any reason not to change this to just fflush(NULL)?  We dropped
support for SunOS 4.1 quite some time ago ...

While it's still true that the postmaster proper doesn't need to fflush
anything but stdout and stderr, this coding seems a bit less than safe
when you consider the possibility of third-party libraries loaded into the
postmaster process.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Display of timestamp in pg_dump custom format
Next
From: Noah Misch
Date:
Subject: Re: Obsolete coding in fork_process.c