summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-11-27 11:01:56 -0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-01-08 16:38:10 -0600
commit3ac4b7c51e3ba181a86983ba2601a595ed8f3b1d (patch)
treeb46c973e0ad117861566c7ae67bfdc450c24659b
parenta9de6d01df3153b2ac0cade11e26a66d596d7166 (diff)
downloadqemu-3ac4b7c51e3ba181a86983ba2601a595ed8f3b1d.tar.gz
qemu-3ac4b7c51e3ba181a86983ba2601a595ed8f3b1d.tar.bz2
qemu-3ac4b7c51e3ba181a86983ba2601a595ed8f3b1d.zip
qemu-ga: qmp_guest_file_close(): fix fclose() error check
fclose() returns EOF on error. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--qga/commands-posix.c2
1 files changed, 1 insertions, 1 deletions
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;
}