• E
    util: make it easier to grab only regular process exit · c72e76c3
    Eric Blake 提交于
    Right now, a caller waiting for a child process either requires
    the child to have status 0, or must use WIFEXITED() and friends
    itself.  But in many cases, we want the middle ground of treating
    fatal signals as an error, and directly accessing the normal exit
    value without having to use WEXITSTATUS(), in order to easily
    detect an expected non-zero exit status.  This adds the middle
    ground to the low-level virProcessWait; the next patch will add
    it to virCommand.
    
    * src/util/virprocess.h (virProcessWait): Alter signature.
    * src/util/virprocess.c (virProcessWait): Add parameter.
    (virProcessRunInMountNamespace): Adjust caller.
    * src/util/vircommand.c (virCommandWait): Likewise.
    * src/util/virfile.c (virFileAccessibleAs): Likewise.
    * src/lxc/lxc_container.c (lxcContainerHasReboot)
    (lxcContainerAvailable): Likewise.
    * daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
    * tools/virt-login-shell.c (main): Likewise.
    * tools/virsh-domain.c (cmdLxcEnterNamespace): Likewise.
    * tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
    * tests/commandtest.c (test23): Likewise.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    c72e76c3
testutils.c 24.0 KB