From: Alan Cox Subject: Re: Re: [Xen-changelog] [xen-unstable] xenstored: Do not write to stderr if we are daemonised! Date: Wed, 1 Aug 2007 23:36:22 +0100 Message-ID: <20070801233622.59a68626@the-village.bc.nu> References: <20070801180323.GA16021@totally.trollied.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com, John Levon List-Id: xen-devel@lists.xenproject.org > Okay, I'll fix this by redirecting xprintf() to trace() and get rid of the > NULL assignments. You are guaranteed to be able to freopen() stdin/stdout/stderr and that is a portable C feature. This means you can divert the stdin/out/err to a log file to catch such accidents or at least avoid future problems by firing them down /dev/null.