now exits instead of restarting if child dies due to an
unexpected signal.
This commit is contained in:
parent
555aa19eb2
commit
a9910041b3
|
@ -102,11 +102,25 @@ int CUnixPlatform::restart(
|
||||||
|
|
||||||
// what happened? if the child exited normally with a
|
// what happened? if the child exited normally with a
|
||||||
// status less than 16 then the child was deliberately
|
// status less than 16 then the child was deliberately
|
||||||
// terminated so we also terminate. otherwise, we
|
// terminated so we also terminate.
|
||||||
// loop.
|
|
||||||
if (WIFEXITED(status) && WEXITSTATUS(status) < minErrorCode) {
|
if (WIFEXITED(status) && WEXITSTATUS(status) < minErrorCode) {
|
||||||
return WEXITSTATUS(status);
|
return WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// did child die horribly?
|
||||||
|
if (WIFSIGNALED(status)) {
|
||||||
|
switch (WTERMSIG(status)) {
|
||||||
|
case SIGHUP:
|
||||||
|
case SIGINT:
|
||||||
|
case SIGQUIT:
|
||||||
|
case SIGTERM:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// uh oh. bail out.
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue