Don't loop on waitpid returning 0
authorSam Hartman <hartmans@debian.org>
Tue, 23 Sep 2014 00:04:41 +0000 (20:04 -0400)
committerSam Hartman <hartmans@debian.org>
Tue, 23 Sep 2014 00:18:44 +0000 (20:18 -0400)
tid/tids.c

index 07d48e7..811fb4b 100644 (file)
@@ -390,7 +390,7 @@ int tids_start (TIDS_INSTANCE *tids,
     }
 
     /* clean up any processes that have completed */
-    while (waitpid(-1, 0, WNOHANG) >= 0);
+    while (waitpid(-1, 0, WNOHANG) > 0);
   }
 
   return 1;    /* should never get here, loops "forever" */