From 0e286705192205cdb00d31d6757ca3dc28fb896a Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 10 Nov 2011 10:41:45 -0200 Subject: [PATCH] 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 --- savevm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.11.4.GIT