Skip to content
Snippets Groups Projects
Commit 0c8542d8 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

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
parent 6065f895
Branches
No related tags found
No related merge requests found
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment