]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/error.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
10 lxc_log_define(error
, lxc
);
12 /*---------------------------------------------------------------------------*/
13 /* lxc_error_set_and_log
14 * function is here to convert
15 * the reported status to an exit code as detailed here:
17 * 0-126 exit code of the application
18 * 128+n signal n received by the application
21 extern int lxc_error_set_and_log(int pid
, int status
)
25 if (WIFEXITED(status
)) {
26 ret
= WEXITSTATUS(status
);
28 INFO("Child <%d> ended on error (%d)", pid
, ret
);
31 if (WIFSIGNALED(status
)) {
32 int signal
= WTERMSIG(status
);
33 INFO("Child <%d> ended on signal (%d)", pid
, signal
);