mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
restorer: Report child's death reason correctly
E.g, if child was killed by SIGSEGV, this message previously was "exited, status=11", as si_code == CLD_DUMPED == 3 in this case will result in (si_code & CLD_KILLED) == (si_code & 1). Which is misleading as you may try to look for exit() calls with 11 arg. Correct if to compare si_code with CLD_*. Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
59c9583992
commit
96602ba854
@@ -102,10 +102,16 @@ static void sigchld_handler(int signal, siginfo_t *siginfo, void *data)
|
|||||||
if (siginfo->si_pid == zombies[i])
|
if (siginfo->si_pid == zombies[i])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (siginfo->si_code & CLD_EXITED)
|
if (siginfo->si_code == CLD_EXITED)
|
||||||
r = "exited, status=";
|
r = "exited, status=";
|
||||||
else if (siginfo->si_code & CLD_KILLED)
|
else if (siginfo->si_code == CLD_KILLED)
|
||||||
r = "killed by signal";
|
r = "killed by signal";
|
||||||
|
else if (siginfo->si_code == CLD_DUMPED)
|
||||||
|
r = "terminated abnormally with";
|
||||||
|
else if (siginfo->si_code == CLD_TRAPPED)
|
||||||
|
r = "trapped with";
|
||||||
|
else if (siginfo->si_code == CLD_STOPPED)
|
||||||
|
r = "stopped with";
|
||||||
else
|
else
|
||||||
r = "disappeared with";
|
r = "disappeared with";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user