summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-07-11 04:22:41 +0000
committertjr <tjr@FreeBSD.org>2002-07-11 04:22:41 +0000
commit0087ce2988c026fb6a09181ccd0528102f00bbde (patch)
treedc1fe3165e5127d1d6f052e0b21bef8f9729c58d /bin
parent3690d03377142839812b5b9e2b96e02098062a1e (diff)
downloadFreeBSD-src-0087ce2988c026fb6a09181ccd0528102f00bbde.zip
FreeBSD-src-0087ce2988c026fb6a09181ccd0528102f00bbde.tar.gz
When growing the job table, don't relocate the jobmru pointer if it's NULL.
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/jobs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index c0d3e4f..845fb15 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -617,7 +617,8 @@ makejob(union node *node __unused, int nprocs)
memcpy(jp, jobtab, njobs * sizeof jp[0]);
#if JOBS
/* Relocate `next' pointers and list head */
- jobmru = &jp[jobmru - jobtab];
+ if (jobmru != NULL)
+ jobmru = &jp[jobmru - jobtab];
for (i = 0; i < njobs; i++)
if (jp[i].next != NULL)
jp[i].next = &jp[jp[i].next -
OpenPOWER on IntegriCloud