From patchwork Tue Jan 8 22:59:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [02/12] qemu-ga: qmp_guest_file_close(): fix fclose() error check Date: Tue, 08 Jan 2013 12:59:59 -0000 From: Michael Roth X-Patchwork-Id: 210571 Message-Id: <1357686009-13139-3-git-send-email-mdroth@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, tomoki.sekiyama.qu@hitachi.com, lcapitulino@redhat.com From: Luiz Capitulino fclose() returns EOF on error. Signed-off-by: Luiz Capitulino Reviewed-by: Michael Roth Signed-off-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 bbef66d..ebb58be 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; }