]> git.ipfire.org Git - thirdparty/libvirt.git/commit
replace last instances of close()
authorStefan Berger <stefanb@us.ibm.com>
Wed, 17 Nov 2010 15:19:13 +0000 (10:19 -0500)
committerStefan Berger <stefanb@us.ibm.com>
Wed, 17 Nov 2010 15:19:13 +0000 (10:19 -0500)
commit8e3051af84eecbb00dca79931cb17b68be5dd171
tree10c87584af27ac4d87b4c64688bc94e634fe9d7b
parentd4897acff85b6c5e06f084cacffd4a5faf5a43e0
replace last instances of close()

I am replacing the last instances of close() I found with VIR_CLOSE() / VIR_FORCE_CLOSE respectively.

The first part patches virsh, which I missed out on previously.

The 2nd patch I had left out intentionally to look at it more carefully:
The 'closed' variable could be easily removed since it wasn't used anywhere else. The possible race condition that could result from the filedescriptor being closed and not set to -1 (and possibly let us write into 'something' totally different if the fd was allocated by another thread) seems to be prevented by the qemuMonitorLock() already placed around the code that reads from or writes to the fd. So the change of this code as shown in the patch should not have any side-effects.
src/qemu/qemu_monitor.c
tools/virsh.c