aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2011-11-10 10:41:44 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-12 11:47:19 -0600
commit26f1af0aa3db024349f6bb6ed7a0ac89052910bb (patch)
tree5461bd78ef6d593e42cb4af12f14df520d73305e /savevm.c
parentd82ca915875ac55ba291435f7eb4fe7bfcb2cecb (diff)
stdio_pclose: return -errno on error (v3)
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>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index adff42140c..392a14f79c 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;
}