From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v3 5/5] mkelf32: Close those file descriptors in the error paths. Date: Thu, 18 Feb 2016 09:45:30 -0700 Message-ID: <56C6033A02000078000D3CAC@prv-mh.provo.novell.com> References: <1455246507-5589-1-git-send-email-konrad.wilk@oracle.com> <1455246507-5589-6-git-send-email-konrad.wilk@oracle.com> <56C5FF6102000078000D3C6B@prv-mh.provo.novell.com> <22213.62372.815878.584227@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWRht-0007FT-ND for xen-devel@lists.xenproject.org; Thu, 18 Feb 2016 16:45:33 +0000 In-Reply-To: <22213.62372.815878.584227@mariner.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 18.02.16 at 17:39, wrote: > Jan Beulich writes ("Re: [PATCH v3 5/5] mkelf32: Close those file descriptors > in the error paths."): >> On 12.02.16 at 04:08, wrote: >> > While we are operating here we may as well fix some of the >> > file descriptor leaks. >> >> I'm not convinced. The added goto-s make the code uglier to read, >> and this being a standalone utility there's not really any leak here. > > I don't buy this `uglier to read'. What `return 1' does is make me > think `is some resource being leaked' and `do I need to audit this > thing'. Certainly a matter of taste to some degree - goto-s are always ugly to read to my eyes. Irrespective of this I don't buy the leak aspect for a non-library like, short running build utility. The close() calls are just more code, with absolutely no added benefit to the system the code runs on. Jan