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>
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 @@
}
ret = fclose(gfh->fh);
- if (ret == -1) {
+ if (ret == EOF) {
error_set(err, QERR_QGA_COMMAND_FAILED, "fclose() failed");
return;
}