Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wfvmh-00012N-S6 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 May 2014 18:32:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wfvmh-0008R2-95 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 May 2014 18:32:39 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wfvmg-0008Qr-1Q for pgsql-hackers@postgresql.org; Thu, 01 May 2014 18:32:38 +0000 Received: from mail-yk0-f181.google.com ([209.85.160.181]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wfvmc-00024F-Lr for pgsql-hackers@postgresql.org; Thu, 01 May 2014 18:32:37 +0000 Received: by mail-yk0-f181.google.com with SMTP id q200so2949642ykb.26 for ; Thu, 01 May 2014 11:32:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=eThzYj/JimFcohYxQxE4BjUVNdC+QU3PJRsHrshiX1Q=; b=JylRkdV86Jby9hvsWPT/cMnO7H747iw4/I/VHt3wlKmpxJEuBwNee+tRFhcH+cYxN5 eA5BEcWZrml7HUtpfEZUG5+uMzkI4EMsVJhXpAJAPZ5F3UX+liZu3760Yuw3ImAJNkHp CVXVwjFnTR2nv8oYr6LQyrbZWJNs4RUsKf6kKw4NkA0Tk+20g86RzYqtwEVQiKFKO5fH sRuxZhntUgYQHlSVbEP9woRbLlVj4Cbi5LZx/DXcb70Y3nnLMUWr0IIZpo6eksXRmZM6 it9DahNWwNvmf/reLlOjYrAY8IxIkkLSbom9me+tSUZjSPwjEwNiDyOQGBlO0dleKhVh 7Wtw== X-Gm-Message-State: ALoCoQnFfajuahbLZTuwt1Y09x7qZzhWtfgLgyp2QNtcsW8FE0g0VpB+4mo9q35W1sfvi6Ol0sHT X-Received: by 10.236.46.5 with SMTP id q5mr16943493yhb.21.1398969153313; Thu, 01 May 2014 11:32:33 -0700 (PDT) Received: from tornado.leadboat.com (c-107-4-219-91.hsd1.va.comcast.net. [107.4.219.91]) by mx.google.com with ESMTPSA id f62sm50164667yhq.6.2014.05.01.11.32.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 01 May 2014 11:32:32 -0700 (PDT) Date: Thu, 1 May 2014 14:32:31 -0400 From: Noah Misch To: Tom Lane Cc: pgsql-hackers@postgreSQL.org Subject: Re: Obsolete coding in fork_process.c Message-ID: <20140501183231.GA1190179@tornado.leadboat.com> References: <30040.1398960808@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30040.1398960808@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.6 (--) 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 On Thu, May 01, 2014 at 12:13:28PM -0400, Tom Lane wrote: > 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 ... Modern systems have other fflush(NULL) problems: http://www.nntp.perl.org/group/perl.perl5.porters/2013/09/msg207692.html http://perl5.git.perl.org/metaconfig.git/blob/master:/U/perl/fflushall.U -- Noah Misch EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers