diff options
author | sjg <sjg@FreeBSD.org> | 2015-04-21 04:40:38 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2015-04-21 04:40:38 +0000 |
commit | af117d16cb9971b98daadf0901466cbf38bd45b5 (patch) | |
tree | d4404a0b758eb6a0547daa01b5eec4d7df64362f /contrib/bmake/job.c | |
parent | 909d1933055072a88a7712a6e880c731d40fce75 (diff) | |
parent | bee1aeb88e274fb1036152cf5e1176049e2dc417 (diff) | |
download | FreeBSD-src-af117d16cb9971b98daadf0901466cbf38bd45b5.zip FreeBSD-src-af117d16cb9971b98daadf0901466cbf38bd45b5.tar.gz |
Merge bmake-20150418
PR: 199486
Diffstat (limited to 'contrib/bmake/job.c')
-rw-r--r-- | contrib/bmake/job.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/contrib/bmake/job.c b/contrib/bmake/job.c index 4e22959..8a7a902 100644 --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.176 2013/08/04 16:48:15 sjg Exp $ */ +/* $NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.176 2013/08/04 16:48:15 sjg Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.176 2013/08/04 16:48:15 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -744,7 +744,6 @@ JobPrintCommand(void *cmdp, void *jobp) shutUp = DEBUG(LOUD) ? FALSE : TRUE; break; case '-': - job->flags |= JOB_IGNERR; errOff = TRUE; break; case '+': @@ -823,6 +822,7 @@ JobPrintCommand(void *cmdp, void *jobp) * to ignore errors. Set cmdTemplate to use the weirdness * instead of the simple "%s\n" template. */ + job->flags |= JOB_IGNERR; if (!(job->flags & JOB_SILENT) && !shutUp) { if (commandShell->hasEchoCtl) { DBPRINTF("%s\n", commandShell->echoOff); @@ -1376,7 +1376,8 @@ JobExec(Job *job, char **argv) (void)fcntl(0, F_SETFD, 0); (void)lseek(0, (off_t)0, SEEK_SET); - if (Always_pass_job_queue || (job->node->type & OP_MAKE)) { + if (Always_pass_job_queue || + (job->node->type & (OP_MAKE | OP_SUBMAKE))) { /* * Pass job token pipe to submakes. */ @@ -1910,16 +1911,16 @@ end_loop: (void)fflush(stdout); } } - if (i < max - 1) { - /* shift the remaining characters down */ - (void)memcpy(job->outBuf, &job->outBuf[i + 1], max - (i + 1)); + /* + * max is the last offset still in the buffer. Move any remaining + * characters to the start of the buffer and update the end marker + * curPos. + */ + if (i < max) { + (void)memmove(job->outBuf, &job->outBuf[i + 1], max - (i + 1)); job->curPos = max - (i + 1); - } else { - /* - * We have written everything out, so we just start over - * from the start of the buffer. No copying. No nothing. - */ + assert(i == max); job->curPos = 0; } } |