]> git.proxmox.com Git - mirror_qemu.git/commitdiff
stdio_pclose: return -errno on error (v3)
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 10 Nov 2011 12:41:44 +0000 (10:41 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 12 Dec 2011 17:47:19 +0000 (11:47 -0600)
This is what qemu_fclose() expects.

Changes v1 -> v2:
 - On success, keep returning pclose() return value, instead of always 0.

Changes v2 -> v3:
 - Add braces on if statements to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
savevm.c

index adff42140c31936500113875e32bf82bd4368a36..392a14f79ce8dbbfbf05070c635189884816e3c5 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -235,6 +235,9 @@ static int stdio_pclose(void *opaque)
     QEMUFileStdio *s = opaque;
     int ret;
     ret = pclose(s->stdio_file);
+    if (ret == -1) {
+        ret = -errno;
+    }
     g_free(s);
     return ret;
 }