remove remaining signal blocking cruft, add ignoring sigchld so that anything we spawn doesn't become a zombie.

This commit is contained in:
Isaac Connor 2021-11-29 18:34:06 -05:00
parent c927ef4b52
commit 1cddac4efd
1 changed files with 7 additions and 7 deletions

View File

@ -220,12 +220,13 @@ int main(int argc, char *argv[]) {
zmSetDefaultTermHandler(); zmSetDefaultTermHandler();
zmSetDefaultDieHandler(); zmSetDefaultDieHandler();
sigset_t block_set; struct sigaction sa;
sigemptyset(&block_set); sa.sa_handler = SIG_IGN; //handle signal by ignoring
sigemptyset(&sa.sa_mask);
sigaddset(&block_set, SIGHUP); sa.sa_flags = 0;
sigaddset(&block_set, SIGUSR1); if (sigaction(SIGCHLD, &sa, 0) == -1) {
sigaddset(&block_set, SIGUSR2); Error("Unable to set SIGCHLD to ignore. There may be zombies.");
}
int result = 0; int result = 0;
int prime_capture_log_count = 0; int prime_capture_log_count = 0;
@ -286,7 +287,6 @@ int main(int argc, char *argv[]) {
Microseconds sleep_time = Microseconds(0); Microseconds sleep_time = Microseconds(0);
while (!zm_terminate) { while (!zm_terminate) {
//sigprocmask(SIG_BLOCK, &block_set, 0);
for (size_t i = 0; i < monitors.size(); i++) { for (size_t i = 0; i < monitors.size(); i++) {
monitors[i]->CheckAction(); monitors[i]->CheckAction();