From: Harry Butterworth Subject: Re: [PATCH] Fix bug #709 by daemonizing blktapctrl and closing stdin, stdout and stderr Date: Tue, 01 Aug 2006 11:20:59 +0100 Message-ID: <1154427660.7694.17.camel@localhost.localdomain> References: <1154358942.7720.15.camel@localhost.localdomain> <20060731173158.GA5587@rhun.ibm.com> <1154426496.7694.10.camel@localhost.localdomain> <20060801100659.GD4774@rhun.haifa.ibm.com> <13dc1dfcded4551cbb42f30cbd746242@cl.cam.ac.uk> <20060801101855.GE4774@rhun.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060801101855.GE4774@rhun.haifa.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Muli Ben-Yehuda 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, 2006-08-01 at 13:18 +0300, Muli Ben-Yehuda wrote: > On Tue, Aug 01, 2006 at 11:13:29AM +0100, Keir Fraser wrote: > > > > On 1 Aug 2006, at 11:06, Muli Ben-Yehuda 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 */ > > > > Yes, that's the better way even though we won't have done tricks such > > as the above when daemonise runs. Also a new patch needs to be based at > > least on xen-unstable 10876 which is the original patch from Harry -- > > it isn't in the public tree yet for some reason: I'll check up on that. > > And any changes may also need to be applied to the xenstored original > > (no sense in updating one and not the other). > > Does it make sense for this to be folded into a common utility > library? Anil Madhavapeddy pointed out it already is: man 3 daemon. > > Cheers, > Muli > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >