Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wftc5-0003qI-4l for pgsql-hackers@arkaria.postgresql.org; Thu, 01 May 2014 16:13:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wftc4-00018W-II for pgsql-hackers@arkaria.postgresql.org; Thu, 01 May 2014 16:13:32 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wftc3-00018M-Ox for pgsql-hackers@postgreSQL.org; Thu, 01 May 2014 16:13:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wftc1-0007tl-8C for pgsql-hackers@postgreSQL.org; Thu, 01 May 2014 16:13:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s41GDSgm030041 for ; Thu, 1 May 2014 12:13:28 -0400 From: Tom Lane To: pgsql-hackers@postgreSQL.org Subject: Obsolete coding in fork_process.c Date: Thu, 01 May 2014 12:13:28 -0400 Message-ID: <30040.1398960808@sss.pgh.pa.us> X-Pg-Spam-Score: -0.7 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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. * Presently stdout 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers