From: Ian Jackson Subject: Re: [PATCH 10/13] libxl: don't try to fclose file twice on error in libxl_userdata_store Date: Mon, 2 Dec 2013 15:04:33 +0000 Message-ID: <21148.41345.663155.201835@mariner.uk.xensource.com> References: <1385892907-20084-1-git-send-email-mattd@bugfuzz.com> <1385892907-20084-11-git-send-email-mattd@bugfuzz.com> <21148.31163.694767.225452@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Daley Cc: Stefano Stabellini , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org Matthew Daley writes ("Re: [PATCH 10/13] libxl: don't try to fclose file twice on error in libxl_userdata_store"): > On Tue, Dec 3, 2013 at 1:14 AM, Ian Jackson wrote: > > This is not correct. If you use write(2) directly you have to call it > > in a loop, in case of partial writes. This is quite tiresome. I > > think it would be better to simply fix the function not to "retry" the > > fclose if it fails the first time. > > Would using libxl_write_exactly be acceptable instead? Yes, I guess, if you prefer. Ian.