summaryrefslogtreecommitdiff
path: root/io/channel-file.c
diff options
context:
space:
mode:
authorRoss Lagerwall <ross.lagerwall@citrix.com>2017-11-01 14:25:25 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2018-02-15 16:54:57 +0000
commita2565df12c59362c061084a0c853dace410cac26 (patch)
tree671ec6dad0f4da0448ff597685887e1d81434055 /io/channel-file.c
parent902f6e14fc68743ce24efb7d87dc3f8464a78bf3 (diff)
io: Don't call close multiple times in QIOChannelFile
If the file descriptor underlying QIOChannelFile is closed in the io_close() method, don't close it again in the finalize() method since the file descriptor number may have been reused in the meantime. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'io/channel-file.c')
-rw-r--r--io/channel-file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io/channel-file.c b/io/channel-file.c
index 16bf7ed270..1f2f710bf9 100644
--- a/io/channel-file.c
+++ b/io/channel-file.c
@@ -178,6 +178,7 @@ static int qio_channel_file_close(QIOChannel *ioc,
"Unable to close file");
return -1;
}
+ fioc->fd = -1;
return 0;
}