remove remaining signal blocking cruft, add ignoring sigchld so that anything we spawn doesn't become a zombie.
This commit is contained in:
parent
c927ef4b52
commit
1cddac4efd
14
src/zmc.cpp
14
src/zmc.cpp
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue