diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2011-11-10 10:41:45 -0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-12 11:47:20 -0600 |
commit | 0e286705192205cdb00d31d6757ca3dc28fb896a (patch) | |
tree | 7b214048e887ccc23af7bde192f4d8b5042c2bbc | |
parent | 26f1af0aa3db024349f6bb6ed7a0ac89052910bb (diff) |
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>
-rw-r--r-- | savevm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |