From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdl2W-0000Wg-RU for qemu-devel@nongnu.org; Wed, 28 Nov 2012 12:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tdl2R-0004OB-2H for qemu-devel@nongnu.org; Wed, 28 Nov 2012 12:03:12 -0500 Received: from mail-ia0-f173.google.com ([209.85.210.173]:41126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdl2Q-0004Nb-UM for qemu-devel@nongnu.org; Wed, 28 Nov 2012 12:03:07 -0500 Received: by mail-ia0-f173.google.com with SMTP id w21so8418279iac.4 for ; Wed, 28 Nov 2012 09:03:06 -0800 (PST) Sender: fluxion Date: Wed, 28 Nov 2012 11:02:37 -0600 From: mdroth Message-ID: <20121128170237.GD8690@vm> References: <1354021324-31561-1-git-send-email-lcapitulino@redhat.com> <1354021324-31561-3-git-send-email-lcapitulino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1354021324-31561-3-git-send-email-lcapitulino@redhat.com> Subject: Re: [Qemu-devel] [PATCH 02/10] qemu-ga: qmp_guest_file_close(): fix fclose() error check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org On Tue, Nov 27, 2012 at 11:01:56AM -0200, Luiz Capitulino wrote: > fclose() returns EOF on error. > > Signed-off-by: Luiz Capitulino Reviewed-by: Michael Roth > --- > qga/commands-posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qga/commands-posix.c b/qga/commands-posix.c > index a2216f2..c284083 100644 > --- a/qga/commands-posix.c > +++ b/qga/commands-posix.c > @@ -170,7 +170,7 @@ void qmp_guest_file_close(int64_t handle, Error **err) > } > > ret = fclose(gfh->fh); > - if (ret == -1) { > + if (ret == EOF) { > error_set(err, QERR_QGA_COMMAND_FAILED, "fclose() failed"); > return; > } > -- > 1.8.0 >