]> git.ipfire.org Git - thirdparty/libvirt.git/commit
waitpid: improve safety
authorEric Blake <eblake@redhat.com>
Fri, 21 Oct 2011 17:09:23 +0000 (11:09 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 24 Oct 2011 21:42:52 +0000 (15:42 -0600)
commit69d044c034dcc2b9af137a6d36f2a54d8944b8fc
treea239aab8e155cf0d6f56cc868bf9dee6db375269
parent2c27dfaeb1881a77a9463fde56a8c314528194d1
waitpid: improve safety

Based on a report by Coverity.  waitpid() can leak resources if it
fails with EINTR, so it should never be used without checking return
status.  But we already have a helper function that does that, so
use it in more places.

* src/lxc/lxc_container.c (lxcContainerAvailable): Use safer
virWaitPid.
* daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
* tests/testutils.c (virtTestCaptureProgramOutput, virtTestMain):
Likewise.
* src/libvirt.c (virConnectAuthGainPolkit): Simplify with virCommand.
daemon/libvirtd.c
src/libvirt.c
src/lxc/lxc_container.c
tests/testutils.c