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>
This commit is contained in:
Ross Lagerwall 2017-11-01 14:25:25 +00:00 committed by Daniel P. Berrangé
parent 902f6e14fc
commit a2565df12c

View file

@ -178,6 +178,7 @@ static int qio_channel_file_close(QIOChannel *ioc,
"Unable to close file");
return -1;
}
fioc->fd = -1;
return 0;
}