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>
This commit is contained in:
Eduardo Habkost 2011-11-10 10:41:45 -02:00 committed by Anthony Liguori
parent 26f1af0aa3
commit 0e28670519

View File

@ -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)