Skip to content

return special exit code when children is killed by signal#59

Open
minijackson wants to merge 1 commit intoralphlange:masterfrom
minijackson:kill-exitcode
Open

return special exit code when children is killed by signal#59
minijackson wants to merge 1 commit intoralphlange:masterfrom
minijackson:kill-exitcode

Conversation

@minijackson
Copy link
Copy Markdown

Allows the process parent of procServ to check if the child was terminated abnormally.

Fixes #58.

Allows the process parent of procServ to check if the child was
terminated abnormally.
Comment thread procServ.cc
// In order to exit as if we were killed, by returning e.g. 137 if
// killed by SIGKILL.
// See: https://tldp.org/LDP/abs/html/exitcodes.html
childExitCode = 128 + WTERMSIG(wstatus);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would childExitCode = wstatus be more portable?

I think the four WIF*() bits are mutually exclusive, so WIFSIGNALED() tests as true, then the others should be false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should procServ exit >0 when the process is terminated by a signal?

2 participants