summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-04 06:49:17 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-04 06:49:17 +0000
commit0c8542d8897f4d29f767c727eb17f54145f670bf (patch)
tree881b0802b2208228d7ffde656e08c3227b9219bc
parent6065f89544a0561d685513356cca125d332e0de3 (diff)
downloadtor-0c8542d8897f4d29f767c727eb17f54145f670bf.tar.gz
tor-0c8542d8897f4d29f767c727eb17f54145f670bf.zip
fix rare race condition that causes infinite loop
if we get a sigchld but all our children are gone by the time we get around to reaping them (i don't think this should ever happen, but it just did), then we'd loop forever trying to reap them. svn:r2141
-rw-r--r--src/or/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 5e27f00721..8f01b4f310 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -842,7 +842,7 @@ static int do_main_loop(void) {
please_reset = 0;
}
if(please_reap_children) {
- while(waitpid(-1,NULL,WNOHANG)) ; /* keep reaping until no more zombies */
+ while(waitpid(-1,NULL,WNOHANG) > 0) ; /* keep reaping until no more zombies */
please_reap_children = 0;
}
#endif /* signal stuff */