提交 0e286705 编写于 作者: E Eduardo Habkost 提交者: Anthony Liguori

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: NEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 26f1af0a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册