Module Name:    src
Committed By:   rillig
Date:           Tue Nov 24 19:04:42 UTC 2020

Modified Files:
        src/usr.bin/make: compat.c
        src/usr.bin/make/unit-tests: deptgt-begin-fail-indirect.exp

Log Message:
make(1): fix error handling for .BEGIN dependency in -k mode


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/make/compat.c
cvs rdiff -u -r1.1 -r1.2 \
    src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.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/compat.c
diff -u src/usr.bin/make/compat.c:1.191 src/usr.bin/make/compat.c:1.192
--- src/usr.bin/make/compat.c:1.191	Tue Nov 24 18:17:45 2020
+++ src/usr.bin/make/compat.c	Tue Nov 24 19:04:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.191 2020/11/24 18:17:45 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.192 2020/11/24 19:04:42 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.191 2020/11/24 18:17:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.192 2020/11/24 19:04:42 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -691,8 +691,7 @@ Compat_Run(GNodeList *targs)
 		gn = Targ_FindNode(".BEGIN");
 		if (gn != NULL) {
 			Compat_Make(gn, gn);
-			/* XXX: Replace with GNode_IsError(gn) */
-			if (gn->made == ERROR) {
+			if (GNode_IsError(gn)) {
 				PrintOnError(gn, "\nStop.");
 				exit(1);
 			}

Index: src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp
diff -u src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp:1.1 src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp:1.2
--- src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp:1.1	Tue Nov 24 19:02:59 2020
+++ src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp	Tue Nov 24 19:04:42 2020
@@ -1,4 +1,6 @@
 false
 *** Error code 1 (continuing)
-: This is not made.
-exit status 0
+
+Stop.
+make: stopped in unit-tests
+exit status 1

Reply via email to