From: Eduardo Habkost Date: Thu, 10 Nov 2011 12:41:45 +0000 (-0200) Subject: stdio_fclose: return -errno on errors (v2) X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0e286705192205cdb00d31d6757ca3dc28fb896a;p=qemu.git 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 Signed-off-by: Anthony Liguori --- diff --git a/savevm.c b/savevm.c index 392a14f79c..b72f6c0d17 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)