summaryrefslogtreecommitdiff
path: root/usr.bin/make/compat.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-12-07 01:10:03 +0000
committerrillig <rillig@NetBSD.org>2020-12-07 01:10:03 +0000
commit526ecb5eeaeedff159f3ff8665433bf7cd0495bd (patch)
tree4260b6bf1aaba3623ca12d3eb6d7ffb8fdfbd24e /usr.bin/make/compat.c
parent18c1ffce17898b345b33dedd2bb667ddf3cdaf52 (diff)
make(1): merge local variables in Compat_Run
Diffstat (limited to 'usr.bin/make/compat.c')
-rw-r--r--usr.bin/make/compat.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index de7b7410be5..b36644c5dba 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.201 2020/12/07 01:07:13 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.202 2020/12/07 01:10:03 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.201 2020/12/07 01:07:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.202 2020/12/07 01:10:03 rillig Exp $");
static GNode *curTarg = NULL;
static pid_t compatChild;
@@ -664,8 +664,7 @@ void
Compat_Run(GNodeList *targs)
{
GNode *gn = NULL; /* Current root target */
- Boolean mainError;
- Boolean endError;
+ Boolean seenError;
if (!shellName)
Shell_Init();
@@ -705,7 +704,7 @@ Compat_Run(GNodeList *targs)
*/
Make_ExpandUse(targs);
- mainError = FALSE;
+ seenError = FALSE;
while (!Lst_IsEmpty(targs)) {
gn = Lst_Dequeue(targs);
Compat_Make(gn, gn);
@@ -715,7 +714,7 @@ Compat_Run(GNodeList *targs)
} else if (gn->made == ABORTED) {
printf("`%s' not remade because of errors.\n",
gn->name);
- mainError = TRUE;
+ seenError = TRUE;
}
}
@@ -724,19 +723,18 @@ Compat_Run(GNodeList *targs)
* the last one succeeds? This should not count as overall success.
*/
if (GNode_IsError(gn))
- mainError = TRUE;
+ seenError = TRUE;
/*
* If the user has defined a .END target, run its commands.
*/
- if (!mainError) {
+ if (!seenError) {
GNode *endNode = Targ_GetEndNode();
Compat_Make(endNode, endNode);
- endError = GNode_IsError(endNode);
- } else
- endError = FALSE;
+ seenError = GNode_IsError(endNode);
+ }
- if (mainError || endError) {
+ if (seenError) {
PrintOnError(gn, "\nStop.");
exit(1);
}