aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2011-11-10 10:41:45 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-12 11:47:20 -0600
commit0e286705192205cdb00d31d6757ca3dc28fb896a (patch)
tree7b214048e887ccc23af7bde192f4d8b5042c2bbc /savevm.c
parent26f1af0aa3db024349f6bb6ed7a0ac89052910bb (diff)
downloadqemu-0e286705192205cdb00d31d6757ca3dc28fb896a.zip
qemu-0e286705192205cdb00d31d6757ca3dc28fb896a.tar.gz
qemu-0e286705192205cdb00d31d6757ca3dc28fb896a.tar.bz2
stdio_fclose: return -errno on errors (v2)
This is what qemu_fclose() expects. Changes v1 -> v2: - Add braces to if statement 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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/savevm.c b/savevm.c
index 392a14f..b72f6c0 100644
--- a/savevm.c
+++ b/savevm.c
@@ -245,9 +245,12 @@ static int stdio_pclose(void *opaque)
static int stdio_fclose(void *opaque)
{
QEMUFileStdio *s = opaque;
- fclose(s->stdio_file);
+ int ret = 0;
+ if (fclose(s->stdio_file) == EOF) {
+ ret = -errno;
+ }
g_free(s);
- return 0;
+ return ret;
}
QEMUFile *qemu_popen(FILE *stdio_file, const char *mode)