From: Ian Jackson Subject: Re: [PATCH] xl: Apply CLOEXEC to the restore_fd. Date: Mon, 28 Nov 2011 17:50:10 +0000 Message-ID: <20179.51666.829995.721200@mariner.uk.xensource.com> References: <1322233395-29575-1-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1322233395-29575-1-git-send-email-anthony.perard@citrix.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: Anthony PERARD Cc: Xen Devel List-Id: xen-devel@lists.xenproject.org Anthony PERARD writes ("[Xen-devel] [PATCH] xl: Apply CLOEXEC to the restore_fd."): > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 080aa2b..8bdfc32 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -1382,6 +1382,7 @@ static int create_domain(struct domain_create *dom_info) > > restore_fd = migrate_fd >= 0 ? migrate_fd : > open(restore_file, O_RDONLY); > + libxl_fd_set_cloexec(restore_fd); I don't think it's really sensible for this function to set cloexec on a descriptor provided by its caller. I'm afraid that although it makes the code longer, I would prefer it if the cloexec was set at each point when the fd is opened. Thanks, Ian.