Merge "Prevent duplicate signals from makeparallel"
This commit is contained in:
commit
70aac88a61
|
@ -357,8 +357,8 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
static pid_t pid;
|
static pid_t pid;
|
||||||
|
|
||||||
// Set up signal handlers to forward SIGHUP, SIGINT, SIGQUIT, SIGTERM, and
|
// Set up signal handlers to forward SIGTERM to child
|
||||||
// SIGALRM to child
|
// Assume that all other signals are sent to the entire process group
|
||||||
struct sigaction action = {};
|
struct sigaction action = {};
|
||||||
action.sa_flags = SA_SIGINFO | SA_RESTART,
|
action.sa_flags = SA_SIGINFO | SA_RESTART,
|
||||||
action.sa_sigaction = [](int signal, siginfo_t*, void*) {
|
action.sa_sigaction = [](int signal, siginfo_t*, void*) {
|
||||||
|
@ -368,11 +368,7 @@ int main(int argc, char* argv[]) {
|
||||||
};
|
};
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (!ret) ret = sigaction(SIGHUP, &action, NULL);
|
|
||||||
if (!ret) ret = sigaction(SIGINT, &action, NULL);
|
|
||||||
if (!ret) ret = sigaction(SIGQUIT, &action, NULL);
|
|
||||||
if (!ret) ret = sigaction(SIGTERM, &action, NULL);
|
if (!ret) ret = sigaction(SIGTERM, &action, NULL);
|
||||||
if (!ret) ret = sigaction(SIGALRM, &action, NULL);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error(errno, errno, "sigaction failed");
|
error(errno, errno, "sigaction failed");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue