summaryrefslogtreecommitdiff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-11-13 14:34:33 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-11-13 14:34:33 +0000
commita6a63a147e4e28a1ac700938c6e7694c6de97e5d (patch)
tree57e657de4f3d4e73cad31e6fad4dabfb2112d790 /Src/exec.c
parent990f7b91df5152bb7b873b7b998615744cd5d8e4 (diff)
downloadzsh-a6a63a147e4e28a1ac700938c6e7694c6de97e5d.tar.gz
zsh-a6a63a147e4e28a1ac700938c6e7694c6de97e5d.zip
19242: Make job table dynamically reallocatable.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c12
1 files changed, 10 insertions, 2 deletions
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;