From: Muli Ben-Yehuda Subject: Re: [PATCH] Fix bug #709 by daemonizing blktapctrl and closing stdin, stdout and stderr Date: Tue, 1 Aug 2006 13:06:59 +0300 Message-ID: <20060801100659.GD4774@rhun.haifa.ibm.com> References: <1154358942.7720.15.camel@localhost.localdomain> <20060731173158.GA5587@rhun.ibm.com> <1154426496.7694.10.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1154426496.7694.10.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Harry Butterworth Cc: andrew.warfield@cl.cam.ac.uk, xen-devel@lists.xensource.com, julian.chesterfield@cl.cam.ac.uk List-Id: xen-devel@lists.xenproject.org On Tue, Aug 01, 2006 at 11:01:36AM +0100, Harry Butterworth wrote: > > Also, fileno(stdin) is nicer. > > Why? I don't think so. fclose(stdin); /* and the rest */ fd = open(...); /* fd is 0 */ close(STDIN_FILENO); /* does the wrong thing */ close(fileno(stdin)); /* does the right thing */ Cheers, Muli