Message ID | 1412195677-24529-3-git-send-email-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/qemu-file.c b/qemu-file.c index 6c8a6c9..482bda6 100644 --- a/qemu-file.c +++ b/qemu-file.c @@ -152,7 +152,7 @@ static int stdio_fclose(void *opaque) QEMUFileStdio *s = opaque; int ret = 0; - if (s->file->ops->put_buffer || s->file->ops->writev_buffer) { + if (qemu_file_is_writable(s->file)) { int fd = fileno(s->stdio_file); struct stat st;
Use the existing function which checks if writev_buffer() or put_buffer() are set, instead of duplicating it. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)