diff options
| author | rillig <rillig@NetBSD.org> | 2020-12-07 01:07:13 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2020-12-07 01:07:13 +0000 |
| commit | 18c1ffce17898b345b33dedd2bb667ddf3cdaf52 (patch) | |
| tree | 9042c24563fb4bde49987bf5e684cc5fb45970da /usr.bin/make/compat.c | |
| parent | cbef203360004d186481879ab4adf4826138f2d9 (diff) | |
make(1): clean up Compat_Run
Now that errors in the main targets and in their dependencies have the
same effect on the .END node and its dependencies, the two variables can
be merged.
Diffstat (limited to 'usr.bin/make/compat.c')
| -rw-r--r-- | usr.bin/make/compat.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 414b02d266f..de7b7410be5 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.200 2020/12/07 01:04:06 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.201 2020/12/07 01:07:13 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.200 2020/12/07 01:04:06 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.201 2020/12/07 01:07:13 rillig Exp $"); static GNode *curTarg = NULL; static pid_t compatChild; @@ -665,7 +665,6 @@ Compat_Run(GNodeList *targs) { GNode *gn = NULL; /* Current root target */ Boolean mainError; - Boolean mainDepError; Boolean endError; if (!shellName) @@ -706,7 +705,7 @@ Compat_Run(GNodeList *targs) */ Make_ExpandUse(targs); - mainDepError = FALSE; + mainError = FALSE; while (!Lst_IsEmpty(targs)) { gn = Lst_Dequeue(targs); Compat_Make(gn, gn); @@ -716,7 +715,7 @@ Compat_Run(GNodeList *targs) } else if (gn->made == ABORTED) { printf("`%s' not remade because of errors.\n", gn->name); - mainDepError = TRUE; + mainError = TRUE; } } @@ -724,19 +723,20 @@ Compat_Run(GNodeList *targs) * XXX: what about multiple main targets if the first few fail but * the last one succeeds? This should not count as overall success. */ - mainError = GNode_IsError(gn); + if (GNode_IsError(gn)) + mainError = TRUE; /* * If the user has defined a .END target, run its commands. */ - if (!mainError && !mainDepError) { + if (!mainError) { GNode *endNode = Targ_GetEndNode(); Compat_Make(endNode, endNode); endError = GNode_IsError(endNode); } else endError = FALSE; - if (mainDepError || mainError || endError) { + if (mainError || endError) { PrintOnError(gn, "\nStop."); exit(1); } |
