From: Ian Jackson Subject: Re: [PATCH v4 09/29] tools/libxl: Fix libxl__carefd_opened() to be more useful with an invalid fd Date: Tue, 14 Jul 2015 14:39:44 +0100 Message-ID: <21925.4384.683619.778535@mariner.uk.xensource.com> References: <1436871584-6522-1-git-send-email-andrew.cooper3@citrix.com> <1436871584-6522-10-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436871584-6522-10-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org Andrew Cooper writes ("[PATCH v4 09/29] tools/libxl: Fix libxl__carefd_opened() to be more useful with an invalid fd"): > In the case that fd is -1, preserve errno and don't attempt to set > CLOEXEC. > > Note that the implementation can still fail, as it ignores fcntl() > errors and may not set CLOEXEC properly. Update the documentation > accordingly until it is fixed. Acked-by: Ian Jackson > Fixing the fnctl() error issue involves more TUITs than I currently > have. I think that if the fcntl set cloexec fails, we should probably abort the program. Ian C, would that be OK with you ? If so then the patch to fix this is trivial. Otherwise all call sites need to grow error handling. Ian.