WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Fix bug #709 by daemonizing blktapctrl and closi

To: Harry Butterworth <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix bug #709 by daemonizing blktapctrl and closing stdin, stdout and stderr
From: Muli Ben-Yehuda <muli@xxxxxxxxxx>
Date: Tue, 1 Aug 2006 13:06:59 +0300
Cc: andrew.warfield@xxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, julian.chesterfield@xxxxxxxxxxxx
Delivery-date: Tue, 01 Aug 2006 03:07:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1154426496.7694.10.camel@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1154358942.7720.15.camel@xxxxxxxxxxxxxxxxxxxxx> <20060731173158.GA5587@xxxxxxxxxxxx> <1154426496.7694.10.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel