From a6a63a147e4e28a1ac700938c6e7694c6de97e5d Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 13 Nov 2003 14:34:33 +0000 Subject: 19242: Make job table dynamically reallocatable. --- Src/exec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 2d9f7ed26..bb4194d52 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -216,7 +216,10 @@ zfork(void) { pid_t pid; - if (thisjob >= MAXJOB - 1) { + /* + * Is anybody willing to explain this test? + */ + if (thisjob >= jobtabsize - 1 && !expandjobtab()) { zerr("job table full", NULL, 0); return -1; } @@ -1024,7 +1027,12 @@ execpline(Estate state, wordcode slcode, int how, int last1) ipipe[0] = ipipe[1] = opipe[0] = opipe[1] = 0; child_block(); - /* get free entry in job table and initialize it */ + /* + * Get free entry in job table and initialize it. + * This is currently the only call to initjob(), so this + * is also the only place where we can expand the job table + * under us. + */ if ((thisjob = newjob = initjob()) == -1) { child_unblock(); return 1; -- cgit v1.2.3