aboutsummaryrefslogtreecommitdiff
path: root/qemu-file.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2014-10-01 17:34:35 -0300
committerJuan Quintela <quintela@trasno.org>2014-10-14 10:28:12 +0200
commit532bc727c34665370ab0ba94a9536fd3a6c2c5bc (patch)
treefe27b84bc4226ac0bf2834ca847fb5b7485961eb /qemu-file.c
parente68dd3659628c41447f46da6657d68da83c3cf88 (diff)
qemu-file: Use qemu_file_is_writable() on stdio_fclose()
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> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'qemu-file.c')
-rw-r--r--qemu-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-file.c b/qemu-file.c
index c303b61373..9cb12239e5 100644
--- a/qemu-file.c
+++ b/qemu-file.c
@@ -175,7 +175,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;