]> git.proxmox.com Git - qemu.git/commitdiff
qemu-ga: qmp_guest_file_close(): fix fclose() error check
authorLuiz Capitulino <lcapitulino@redhat.com>
Tue, 27 Nov 2012 13:01:56 +0000 (11:01 -0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 8 Jan 2013 22:38:10 +0000 (16:38 -0600)
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>
qga/commands-posix.c

index bbef66dc6a47b0be3d0cd3f046e7685d4bb62a7d..ebb58be22e104243dfbd00663030f7c9319549a3 100644 (file)
@@ -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;
     }