From 817bcabff5c24655844726121c76848d09758871 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 26 Jan 2020 12:35:58 +0000 Subject: simplify logic in compat engine, we can set ABORTED directly instead of waiting for the father to do so. okay millert@ --- usr.bin/make/compat.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'usr.bin/make') diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 793a5d5632a..0676defa7e3 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.91 2020/01/13 15:41:53 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.92 2020/01/26 12:35:57 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -116,9 +116,7 @@ CompatMake(void *gnp, /* The node to make */ * transformations the suffix module thinks are necessary. * Once that's done, we can descend and make all our children. * If any of them has an error but the -k flag was given, - * our 'must_make' field will be set false again. This is our - * signal to not attempt to do anything but abort our - * parent as well. */ + * we will abort. */ gn->must_make = true; gn->built_status = BUILDING; /* note that, in case we have siblings, we only check all @@ -132,10 +130,9 @@ CompatMake(void *gnp, /* The node to make */ sib = sib->sibling; } while (sib != gn); - if (!gn->must_make) { + if (gn->built_status == ABORTED) { Error("Build for %s aborted", gn->name); - gn->built_status = ABORTED; - pgn->must_make = false; + pgn->built_status = ABORTED; return; } @@ -233,7 +230,7 @@ CompatMake(void *gnp, /* The node to make */ Make_TimeStamp(pgn, gn); } } else if (keepgoing) - pgn->must_make = false; + pgn->built_status = ABORTED; else { print_errors(); exit(1); @@ -242,12 +239,12 @@ CompatMake(void *gnp, /* The node to make */ case ERROR: /* Already had an error when making this beastie. Tell the * parent to abort. */ - pgn->must_make = false; + pgn->built_status = ABORTED; break; case BUILDING: Error("Graph cycles through %s", gn->name); gn->built_status = ERROR; - pgn->must_make = false; + pgn->built_status = ABORTED; break; case REBUILT: if ((gn->type & OP_EXEC) == 0) { -- cgit v1.2.3