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:
parent
26f1af0aa3
commit
0e28670519
7
savevm.c
7
savevm.c
@ -245,9 +245,12 @@ static int stdio_pclose(void *opaque)
|
|||||||
static int stdio_fclose(void *opaque)
|
static int stdio_fclose(void *opaque)
|
||||||
{
|
{
|
||||||
QEMUFileStdio *s = opaque;
|
QEMUFileStdio *s = opaque;
|
||||||
fclose(s->stdio_file);
|
int ret = 0;
|
||||||
|
if (fclose(s->stdio_file) == EOF) {
|
||||||
|
ret = -errno;
|
||||||
|
}
|
||||||
g_free(s);
|
g_free(s);
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QEMUFile *qemu_popen(FILE *stdio_file, const char *mode)
|
QEMUFile *qemu_popen(FILE *stdio_file, const char *mode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user