[lxc-devel] lxc-attach exit code

Ashvin Goel ashvin.goel at gmail.com
Wed Jul 16 09:25:20 UTC 2014


Hi,

lxc-attach returns the exit code of the program it ran when the program
exits normally (when WIFEXITED returns true, see below). However, when a
program is killed/signaled, lxc-attach returns 1. So currently, it is not
possible to determine whether the program was signaled (because
WEXITSTATUS(ret) may be 1). I was wondering why the exit code of the child
program is not returned by lxc-attach in all cases when ret > 0.

Attached snippet:

ret = lxc_wait_for_pid_status(pid);
if (ret < 0)
return 1;

if (WIFEXITED(ret))
return WEXITSTATUS(ret);

return 1;



Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140716/3cf05022/attachment.html>


More information about the lxc-devel mailing list