Module Name: src
Committed By: sjg
Date: Fri Jan 8 21:46:50 UTC 2021
Modified Files:
src/usr.bin/make: job.c main.c
src/usr.bin/make/unit-tests: jobs-error-nested-make.exp
Log Message:
Ensure PrintOnError always reports 'stopped in' on first call.
We may still suppress the rest of the noise if shouldDieQuietly
says to, but the 'stopped in' output is too important to lose.
Avoid repeating it though in the same process.
For the case of aborting due to failure detected elsewhere,
exit 6 so we have a clue.
PR: 55578
Reviewed by:
To generate a diff of this commit:
cvs rdiff -u -r1.393 -r1.394 src/usr.bin/make/job.c
cvs rdiff -u -r1.508 -r1.509 src/usr.bin/make/main.c
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/jobs-error-nested-make.exp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.393 src/usr.bin/make/job.c:1.394
--- src/usr.bin/make/job.c:1.393 Fri Jan 8 04:36:44 2021
+++ src/usr.bin/make/job.c Fri Jan 8 21:46:50 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.393 2021/01/08 04:36:44 sjg Exp $ */
+/* $NetBSD: job.c,v 1.394 2021/01/08 21:46:50 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.393 2021/01/08 04:36:44 sjg Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.394 2021/01/08 21:46:50 sjg Exp $");
/*
* A shell defines how the commands are run. All commands for a target are
@@ -2864,7 +2864,7 @@ Job_TokenWithdraw(void)
errno == EAGAIN)
continue;
if (shouldDieQuietly(NULL, 1))
- exit(2);
+ exit(6); /* we aborted */
Fatal("A failure has been detected "
"in another branch of the parallel make");
}
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.508 src/usr.bin/make/main.c:1.509
--- src/usr.bin/make/main.c:1.508 Thu Dec 31 17:39:36 2020
+++ src/usr.bin/make/main.c Fri Jan 8 21:46:50 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.508 2020/12/31 17:39:36 rillig Exp $ */
+/* $NetBSD: main.c,v 1.509 2021/01/08 21:46:50 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.508 2020/12/31 17:39:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.509 2021/01/08 21:46:50 sjg Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -2132,16 +2132,16 @@ PrintOnError(GNode *gn, const char *msg)
Var_Stats();
}
- /* we generally want to keep quiet if a sub-make died */
- if (shouldDieQuietly(gn, -1))
- return;
+ if (errorNode != NULL)
+ return; /* we've been here! */
if (msg != NULL)
printf("%s", msg);
printf("\n%s: stopped in %s\n", progname, curdir);
- if (errorNode != NULL)
- return; /* we've been here! */
+ /* we generally want to keep quiet if a sub-make died */
+ if (shouldDieQuietly(gn, -1))
+ return;
if (gn != NULL)
SetErrorVars(gn);
Index: src/usr.bin/make/unit-tests/jobs-error-nested-make.exp
diff -u src/usr.bin/make/unit-tests/jobs-error-nested-make.exp:1.2 src/usr.bin/make/unit-tests/jobs-error-nested-make.exp:1.3
--- src/usr.bin/make/unit-tests/jobs-error-nested-make.exp:1.2 Thu Jan 7 18:11:23 2021
+++ src/usr.bin/make/unit-tests/jobs-error-nested-make.exp Fri Jan 8 21:46:50 2021
@@ -6,4 +6,6 @@ make: stopped in unit-tests
1 error
make: stopped in unit-tests
+
+make: stopped in unit-tests
exit status 2