Pārlūkot izejas kodu

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
Roger Dingledine 21 gadi atpakaļ
vecāks
revīzija
0c8542d889
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/or/main.c

+ 1 - 1
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 */