summaryrefslogtreecommitdiff
path: root/usr.bin/make/job.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-12-01 15:14:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-12-01 15:14:35 +0000
commita165b98b792e9e4cdfecd6c825c8d03d912554a0 (patch)
tree742979e730a9680021302274e676e0db236de29a /usr.bin/make/job.c
parent6c827c06b35a8d3e563804ee986327ed0aa87bcc (diff)
I was sure I had committed this already, grrrr.
Anyways, switch to a growable array for job to do. Allows us to randomize it. fix manpage. do not add delay if just one job to run.
Diffstat (limited to 'usr.bin/make/job.c')
-rw-r--r--usr.bin/make/job.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 0124a7afbb4..7fe27c1c026 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: job.c,v 1.109 2007/11/28 09:40:08 espie Exp $ */
+/* $OpenBSD: job.c,v 1.110 2007/12/01 15:14:34 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -764,7 +764,8 @@ JobExec(Job *job)
#endif /* USE_PGRP */
if (random_delay)
- usleep(random() % random_delay);
+ if (!(nJobs == 1 && no_jobs_left()))
+ usleep(random() % random_delay);
/* most cases won't return, but will exit directly */
result = run_gnode(job->node, 1);