]> xenbits.xensource.com Git - libvirt.git/commit
util: preserve exit status from mount namespace callback
authorEric Blake <eblake@redhat.com>
Wed, 19 Feb 2014 19:39:44 +0000 (12:39 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 3 Mar 2014 19:40:31 +0000 (12:40 -0700)
commit8b24a803adcdbda11b0e080cb1dc3d13c83cd0d0
tree1f4edad9a431ed87462fee6dd7735e4d01ff3dc3
parent2b4f162eb4ca0f161fbdb66c5814cd02bfa665ca
util: preserve exit status from mount namespace callback

The documentation of namespace callbacks was inconsistent on whether
it preserved positive return values.  Now that we have a dedicated
EXIT_CANCELED to flag all errors before getting to the callback,
it is possible to use positive return values (not that any of the
current callers do, but it is better to match the docs).

Also, while vircommand.c is careful to close fds that a child should
not have, it's still better to be in the practice of setting
FD_CLOEXEC up front.

* src/util/virprocess.c (virProcessRunInMountNamespace): Tweak
return value to pass back non-zero status.  Avoid leaking pipe fds
to other threads.
* src/util/virprocess.h: Fix comment.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virprocess.c
src/util/virprocess.h