summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-05-12 14:16:44 +0000
committerharti <harti@FreeBSD.org>2005-05-12 14:16:44 +0000
commite7ab78380c4d30d28dbf699ac0bffeb881f56c83 (patch)
tree62f3bf0ee1d651af1f65a442f72505ae0f4ba19c /usr.bin/make
parent1fd70549f81b5f11ba2eac3355822f193aae07b6 (diff)
downloadFreeBSD-src-e7ab78380c4d30d28dbf699ac0bffeb881f56c83.zip
FreeBSD-src-e7ab78380c4d30d28dbf699ac0bffeb881f56c83.tar.gz
Fix the fix for bin/72510 applied in job.c:1.70. Actually there have
been two maxJobs variables: one static in job.c and one global used in main.c and parse.c. Makeing one global out of these was the wrong way to fix the problem. Instead rename the global one to jobLimit and keep maxJobs static in job.c. Suggested by: rwatson PR: bin/72510
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/globals.h1
-rw-r--r--usr.bin/make/job.c7
-rw-r--r--usr.bin/make/job.h2
-rw-r--r--usr.bin/make/main.c9
-rw-r--r--usr.bin/make/parse.c2
5 files changed, 13 insertions, 8 deletions
diff --git a/usr.bin/make/globals.h b/usr.bin/make/globals.h
index e23de1e..e6d1e65 100644
--- a/usr.bin/make/globals.h
+++ b/usr.bin/make/globals.h
@@ -69,6 +69,7 @@ extern struct Path parseIncPath;
/* The system include path. */
extern struct Path sysIncPath;
+extern int jobLimit; /* -j argument: maximum number of jobs */
extern Boolean jobsRunning; /* True if jobs are running */
extern Boolean compatMake; /* True if we are make compatible */
extern Boolean ignoreErrors; /* True if should ignore all errors */
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index f5b555b..279fb66 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -400,7 +400,12 @@ static struct Shell *commandShell = NULL;
static char *shellPath = NULL; /* full pathname of executable image */
static char *shellName = NULL; /* last component of shell */
-int maxJobs; /* The most children we can run at once */
+/*
+ * The maximum number of jobs that may run. This is initialize from the
+ * -j argument for the leading make and from the FIFO for sub-makes.
+ */
+static int maxJobs;
+
static int nJobs; /* The number of children currently running */
/* The structures that describe them */
diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h
index 987b5fd..04253b8 100644
--- a/usr.bin/make/job.h
+++ b/usr.bin/make/job.h
@@ -56,8 +56,6 @@ struct Buffer;
struct GNode;
struct Lst;
-extern int maxJobs; /* Number of jobs that may run */
-
void Shell_Init(void);
void Job_Touch(struct GNode *, Boolean);
Boolean Job_CheckCommands(struct GNode *, void (*abortProc)(const char *, ...));
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 5b45678..8e41fd8 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -122,6 +122,7 @@ static Boolean expandVars; /* fully expand printed variables */
static Lst variables = Lst_Initializer(variables);
static Boolean forceJobs; /* -j argument given */
+int jobLimit; /* -j argument: maximum number of jobs */
Boolean compatMake; /* -B argument */
Boolean debug; /* -d flag */
Boolean noExecute; /* -n flag */
@@ -362,8 +363,8 @@ rearg:
char *endptr;
forceJobs = TRUE;
- maxJobs = strtol(optarg, &endptr, 10);
- if (maxJobs <= 0 || *endptr != '\0') {
+ jobLimit = strtol(optarg, &endptr, 10);
+ if (jobLimit <= 0 || *endptr != '\0') {
warnx("illegal number, -j argument -- %s",
optarg);
usage();
@@ -695,7 +696,7 @@ main(int argc, char **argv)
debug = 0; /* No debug verbosity, please. */
jobsRunning = FALSE;
- maxJobs = DEFMAXJOBS;
+ jobLimit = DEFMAXJOBS;
forceJobs = FALSE; /* No -j flag */
compatMake = FALSE; /* No compat mode */
@@ -977,7 +978,7 @@ main(int argc, char **argv)
* should it exist).
*/
if (!queryFlag) {
- Job_Init(maxJobs);
+ Job_Init(jobLimit);
jobsRunning = TRUE;
}
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 4df224f..219675f 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -882,7 +882,7 @@ ParseDoDependency(char *line)
DEFAULT = gn;
break;
case NotParallel:
- maxJobs = 1;
+ jobLimit = 1;
break;
case SingleShell:
compatMake = 1;
OpenPOWER on IntegriCloud