From 3ac4b7c51e3ba181a86983ba2601a595ed8f3b1d Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Tue, 27 Nov 2012 11:01:56 -0200 Subject: qemu-ga: qmp_guest_file_close(): fix fclose() error check 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(-) (limited to 'qga') diff --git a/qga/commands-posix.c b/qga/commands-posix.c index bbef66dc6a..ebb58be22e 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; } -- cgit v1.2.3