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

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 9, 2011, 10:03 p.m.
Message ID <1320876205-16113-7-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/124735/
State New
Headers show

Comments

Eduardo Habkost - Nov. 9, 2011, 10:03 p.m.
This is what qemu_fclose() expects.

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

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 savevm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/savevm.c b/savevm.c
index 6e60c18..5112d66 100644
--- a/savevm.c
+++ b/savevm.c
@@ -235,6 +235,8 @@  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;
 }