From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdKnt-0007oS-CY for qemu-devel@nongnu.org; Tue, 27 Nov 2012 08:02:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdKnk-0005Za-Nm for qemu-devel@nongnu.org; Tue, 27 Nov 2012 08:02:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdKnk-0005ZW-Gj for qemu-devel@nongnu.org; Tue, 27 Nov 2012 08:02:12 -0500 From: Luiz Capitulino Date: Tue, 27 Nov 2012 11:01:56 -0200 Message-Id: <1354021324-31561-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1354021324-31561-1-git-send-email-lcapitulino@redhat.com> References: <1354021324-31561-1-git-send-email-lcapitulino@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com fclose() returns EOF on error. Signed-off-by: Luiz Capitulino --- 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