summaryrefslogtreecommitdiff
path: root/usr.bin/make/make.c
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2006-01-04 21:16:53 +0000
committerdsl <dsl@NetBSD.org>2006-01-04 21:16:53 +0000
commit68ab653c0ca73541870c7e366a8d924252909129 (patch)
tree6602ffeb4b2dcb8007d7931ca8e70f5e533e56e5 /usr.bin/make/make.c
parent23917a5e48525eb528467cce6a93fd480f1b314e (diff)
For parallel makes, don't recycle the job token when we decide not to
run anything.
Diffstat (limited to 'usr.bin/make/make.c')
-rw-r--r--usr.bin/make/make.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index a161d173030..c4af329171a 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.58 2005/08/08 16:42:54 christos Exp $ */
+/* $NetBSD: make.c,v 1.59 2006/01/04 21:16:53 dsl Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.58 2005/08/08 16:42:54 christos Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.59 2006/01/04 21:16:53 dsl Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.58 2005/08/08 16:42:54 christos Exp $");
+__RCSID("$NetBSD: make.c,v 1.59 2006/01/04 21:16:53 dsl Exp $");
#endif
#endif /* not lint */
#endif
@@ -931,6 +931,7 @@ static Boolean
MakeStartJobs(void)
{
GNode *gn;
+ int have_token = 0;
while (!Lst_IsEmpty (toBeMade)) {
gn = (GNode *)Lst_DeQueue(toBeMade);
@@ -966,10 +967,11 @@ MakeStartJobs(void)
}
}
- if (!Job_TokenWithdraw()) {
+ if (!have_token && !Job_TokenWithdraw()) {
Lst_AtFront(toBeMade, gn);
break;
}
+ have_token = 1;
numNodes--;
if (Make_OODate(gn)) {
@@ -981,6 +983,7 @@ MakeStartJobs(void)
}
Make_DoAllVar(gn);
Job_Make(gn);
+ have_token = 0;
} else {
if (DEBUG(MAKE)) {
printf("up-to-date\n");
@@ -995,10 +998,13 @@ MakeStartJobs(void)
*/
Make_DoAllVar(gn);
}
- Job_TokenReturn();
Make_Update(gn);
}
}
+
+ if (have_token)
+ Job_TokenReturn();
+
return (FALSE);
}