diff options
-rw-r--r-- | usr.bin/make/error.c | 11 | ||||
-rw-r--r-- | usr.bin/make/error.h | 5 | ||||
-rw-r--r-- | usr.bin/make/job.c | 5 |
3 files changed, 14 insertions, 7 deletions
diff --git a/usr.bin/make/error.c b/usr.bin/make/error.c index 314b6d7a04e..eee710f1a18 100644 --- a/usr.bin/make/error.c +++ b/usr.bin/make/error.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: error.c,v 1.14 2007/11/02 17:27:24 espie Exp $ */ +/* $OpenBSD: error.c,v 1.15 2007/11/03 10:41:48 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -41,7 +41,9 @@ #include "lowparse.h" -int fatal_errors = 0; +int fatal_errors = 0; +bool supervise_jobs = false; + static void ParseVErrorInternal(const char *, unsigned long, int, const char *, va_list); /*- * Error -- @@ -73,9 +75,10 @@ Fatal(char *fmt, ...) { va_list ap; - va_start(ap, fmt); - Job_Wait(); + if (supervise_jobs) + Job_Wait(); + va_start(ap, fmt); (void)vfprintf(stderr, fmt, ap); va_end(ap); (void)fprintf(stderr, "\n"); diff --git a/usr.bin/make/error.h b/usr.bin/make/error.h index 7436b34c7b7..e501b52f9a9 100644 --- a/usr.bin/make/error.h +++ b/usr.bin/make/error.h @@ -1,7 +1,7 @@ #ifndef ERROR_H #define ERROR_H /* $OpenPackages$ */ -/* $OpenBSD: error.h,v 1.7 2001/09/19 10:58:07 mpech Exp $ */ +/* $OpenBSD: error.h,v 1.8 2007/11/03 10:41:48 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -57,4 +57,7 @@ extern void Finish(int); #define PARSE_FATAL 1 extern void Parse_Error(int, const char *, ...); extern int fatal_errors; +/* Needed for fatal errors: we have to know whether we must abort other jobs + * or not */ +extern bool supervise_jobs; #endif diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 363f553a76e..d730c0d5605 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: job.c,v 1.103 2007/11/03 10:38:14 espie Exp $ */ +/* $OpenBSD: job.c,v 1.104 2007/11/03 10:41:48 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -738,7 +738,7 @@ JobExec(Job *job) if ((cpid = fork()) == -1) { Punt("Cannot fork"); } else if (cpid == 0) { - + supervise_jobs = false; /* standard pipe code to route stdout and stderr */ close(fdout[0]); if (dup2(fdout[1], 1) == -1) @@ -777,6 +777,7 @@ JobExec(Job *job) exit(1); } } else { + supervise_jobs = true; job->pid = cpid; /* we set the current position in the buffers to the beginning |