[06/10] stdio_pclose: return -errno on error (v3)

Submitted by Eduardo Habkost on Nov. 10, 2011, 12:41 p.m.

Details

Message ID 1320928908-19076-7-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Nov. 10, 2011, 12:41 p.m.
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>
---
 savevm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/savevm.c b/savevm.c
index 2fef693..a870b3f 100644
--- 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;
 }