From: Antonio Terceiro Date: Sun, 18 Aug 2019 20:30:32 +0000 (-0300) Subject: lxc-attach: make sure exit status of command is returned X-Git-Tag: lxc-4.0.0~128^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3122%2Fhead;p=thirdparty%2Flxc.git lxc-attach: make sure exit status of command is returned Commit ae68cad763d5b39a6a9e51de2acd1ad128b720ca introduced a regression that makes lxc-attach ignore the exit status of the executed command. This was first identified in 3.0.4 LTS, while it worked on 3.0.3. # lxc-attach --version 3.0.4 # lxc-attach -n test false; echo $? 0 Signed-off-by: Antonio Terceiro Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934983 --- diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c index 917cca282..c3e1e6182 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -385,10 +385,9 @@ int main(int argc, char *argv[]) ret = lxc_wait_for_pid_status(pid); if (ret < 0) goto out; - - if (WIFEXITED(ret)) - wexit = WEXITSTATUS(ret); } + if (WIFEXITED(ret)) + wexit = WEXITSTATUS(ret); out: lxc_container_put(c);