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>
This commit is contained in:
Luiz Capitulino 2012-11-27 11:01:56 -02:00 committed by Michael Roth
parent a9de6d01df
commit 3ac4b7c51e

View 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;
}