Skip to content

Commit

Permalink
io: Don't call close multiple times in QIOChannelFile
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
  • Loading branch information
rosslagerwall authored and berrange committed Feb 15, 2018
1 parent 902f6e1 commit a2565df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions io/channel-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ static int qio_channel_file_close(QIOChannel *ioc,
"Unable to close file");
return -1;
}
fioc->fd = -1;
return 0;
}

Expand Down

0 comments on commit a2565df

Please sign in to comment.