summaryrefslogtreecommitdiff
path: root/src/core/wee-sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/wee-sys.c')
-rw-r--r--src/core/wee-sys.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/wee-sys.c b/src/core/wee-sys.c
index 7560b80aa..0a6fd8ec6 100644
--- a/src/core/wee-sys.c
+++ b/src/core/wee-sys.c
@@ -349,13 +349,16 @@ sys_display_rusage ()
*/
void
-sys_waitpid ()
+sys_waitpid (int number_processes)
{
int i;
+ if (number_processes < 1)
+ return;
+
/* acknowledge the end of up to 42 forked processes */
i = 0;
- while ((i < 42) && (waitpid (-1, NULL, WNOHANG) > 0))
+ while ((i < number_processes) && (waitpid (-1, NULL, WNOHANG) > 0))
{
i++;
}