From 4ed03965a5a412bf58540e678f48f6c331ad30d9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 9 Apr 2014 13:45:27 -0400 Subject: New waitpid-handler functions to run callbacks when a child exits. Also, move 'procmon' into libor_event library, since it uses libevent. --- src/or/main.c | 4 ++-- src/or/or.h | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/or') diff --git a/src/or/main.c b/src/or/main.c index 6713d8036..2ca717459 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -54,6 +54,7 @@ #include "routerparse.h" #include "statefile.h" #include "status.h" +#include "util_process.h" #include "ext_orport.h" #ifdef USE_DMALLOC #include @@ -2097,8 +2098,7 @@ process_signal(uintptr_t sig) break; #ifdef SIGCHLD case SIGCHLD: - while (waitpid(-1,NULL,WNOHANG) > 0) ; /* keep reaping until no more - zombies */ + notify_pending_waitpid_callbacks(); break; #endif case SIGNEWNYM: { diff --git a/src/or/or.h b/src/or/or.h index aeaeb8e6a..9586034d1 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -42,9 +42,6 @@ #include /* FreeBSD needs this to know what version it is */ #endif #include "torint.h" -#ifdef HAVE_SYS_WAIT_H -#include -#endif #ifdef HAVE_SYS_FCNTL_H #include #endif -- cgit v1.2.3