1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 05:00:59 +01:00

19242: Make job table dynamically reallocatable.

This commit is contained in:
Peter Stephenson 2003-11-13 14:34:33 +00:00
parent 990f7b91df
commit a6a63a147e
12 changed files with 194 additions and 93 deletions

View file

@ -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;