]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc.init: correctly exit with the app's error code
authorTycho Andersen <tycho@tycho.ws>
Fri, 19 Jan 2018 03:21:10 +0000 (03:21 +0000)
committerTycho Andersen <tycho@tycho.ws>
Fri, 19 Jan 2018 03:21:10 +0000 (03:21 +0000)
commit4f4530faa742e39fb0e0cd3d08de07f36e2b0fc8
tree270452fd9aee902cc5c153d5c8f71ca6d1e1d1e6
parent19cfa02c4c7bd29cdf10462878d06d025fcc3d27
lxc.init: correctly exit with the app's error code

Based on the comments in the code (and the have_status flag), the intent
here (and IMO, the desired behavior) should be for init.lxc to propagate
the actual exit code from the real application process up through.
Otherwise, it is swallowed and nobody can access it.

The bug being fixed here is that ret held the correct exit code, but when
it went around the loop again (to wait for other children) ret is
clobbered. Let's save the desired exit status somewhere else, so it can't
get clobbered, and we propagate things correctly.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
src/lxc/lxc_init.c