stdio_pclose: return -errno on error (v3)
This is what qemu_fclose() expects. Changes v1 -> v2: - On success, keep returning pclose() return value, instead of always 0. Changes v2 -> v3: - Add braces on if statements 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
d82ca91587
commit
26f1af0aa3
1 changed files with 3 additions and 0 deletions
3
savevm.c
3
savevm.c
|
|
@ -235,6 +235,9 @@ static int stdio_pclose(void *opaque)
|
|||
QEMUFileStdio *s = opaque;
|
||||
int ret;
|
||||
ret = pclose(s->stdio_file);
|
||||
if (ret == -1) {
|
||||
ret = -errno;
|
||||
}
|
||||
g_free(s);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue