]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix lxc_error_set_and_log to match the docs
authorTycho Andersen <tycho@tycho.ws>
Fri, 19 Jan 2018 03:20:08 +0000 (03:20 +0000)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Jan 2018 14:19:32 +0000 (15:19 +0100)
The documentation for this function says if the task was killed by a
signal, the return code will be 128+n, where n is the signal number. Let's
make that actually true.

(We'll use this behavior in later patches.)

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

index 81d6a376e825942fddba4958dfb82faec7643c5c..9147a6afb7dbf328994842d4095264fabcd05746 100644 (file)
@@ -52,6 +52,7 @@ extern int  lxc_error_set_and_log(int pid, int status)
        if (WIFSIGNALED(status)) {
                int signal = WTERMSIG(status);
                INFO("Child <%d> ended on signal (%d)", pid, signal);
+               ret = 128 + signal;
        }
 
        return ret;