From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve0Pc-00051d-51 for qemu-devel@nongnu.org; Wed, 06 Nov 2013 05:32:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ve0PT-0007nv-Oo for qemu-devel@nongnu.org; Wed, 06 Nov 2013 05:32:36 -0500 Received: from mail-ee0-x22e.google.com ([2a00:1450:4013:c00::22e]:58779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve0PT-0007nj-HL for qemu-devel@nongnu.org; Wed, 06 Nov 2013 05:32:27 -0500 Received: by mail-ee0-f46.google.com with SMTP id b57so2034896eek.33 for ; Wed, 06 Nov 2013 02:32:26 -0800 (PST) Date: Wed, 6 Nov 2013 11:32:24 +0100 From: Stefan Hajnoczi Message-ID: <20131106103224.GC24507@stefanha-thinkpad.redhat.com> References: <1383678213-2497-1-git-send-email-mreitz@redhat.com> <52794671.7000001@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52794671.7000001@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: Save errno before error_setg_errno List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz On Tue, Nov 05, 2013 at 12:26:41PM -0700, Eric Blake wrote: > On 11/05/2013 12:03 PM, Max Reitz wrote: > > error_setg_errno() may overwrite errno; therefore, its value should be > > read before calling that function and not afterwards. > > > > Signed-off-by: Max Reitz > > --- > > block.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Reviewed-by: Eric Blake > > Still, wouldn't it be easier to patch error_setg_errno (and friends) to > guarantee that errno is unchanged on exit compared to its value on > entrance, rather than having to audit for other mistakes like this? Agreed, that can be done as a separate patch. Stefan