summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-15 13:30:21 -0400
committerPaul Smith <psmith@gnu.org>2013-09-15 13:30:21 -0400
commit0a81d50d66565fd3e930fadaadc4a5cb9381d840 (patch)
treef0e6bc5b2586260bb3f20fcb236b150d7756a39f /main.c
parent3aa2aa7e82ac4c74df298f381c8d1d280cff852e (diff)
downloadgunmake-0a81d50d66565fd3e930fadaadc4a5cb9381d840.tar.gz
[SV 39203] Don't set MAKEFLAGS when restarting.
We are restarting with the original command line flags, so if we set MAKEFLAGS as well that will cause double flags.
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/main.c b/main.c
index 575ca92..0fdf501 100644
--- a/main.c
+++ b/main.c
@@ -1887,12 +1887,14 @@ main (int argc, char **argv, char **envp)
jobserver. If !job_slots and we don't have a pipe, we can start
infinite jobs. If we see both a pipe and job_slots >0 that means the
user set -j explicitly. This is broken; in this case obey the user
- (ignore the jobserver pipe for this make) but print a message. */
+ (ignore the jobserver pipe for this make) but print a message.
+ If we've restarted, we already printed this the first time. */
if (job_slots > 0)
- error (NILF,
- _("warning: -jN forced in submake: disabling jobserver mode."));
-
+ {
+ if (! restarts)
+ error (NILF, _("warning: -jN forced in submake: disabling jobserver mode."));
+ }
#ifndef WINDOWS32
/* Create a duplicate pipe, that will be closed in the SIGCHLD
handler. If this fails with EBADF, the parent has closed the pipe
@@ -2279,14 +2281,6 @@ main (int argc, char **argv, char **envp)
if (master_job_slots)
job_slots = master_job_slots;
- /* Reset makeflags in case they were changed. */
- {
- const char *pv = define_makeflags (1, 0);
- char *p = alloca (CSTRLEN ("MAKEFLAGS=") + strlen (pv) + 1);
- sprintf (p, "MAKEFLAGS=%s", pv);
- putenv (allocated_variable_expand (p));
- }
-
if (ISDB (DB_BASIC))
{
char **p;