Module Name:    src
Committed By:   sjg
Date:           Mon Sep 28 01:24:34 UTC 2020

Modified Files:
        src/usr.bin/make: parse.c
        src/usr.bin/make/unit-tests: error.exp

Log Message:
Ensure that parse errors report 'stopped in'


To generate a diff of this commit:
cvs rdiff -u -r1.338 -r1.339 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/error.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/parse.c
diff -u src/usr.bin/make/parse.c:1.338 src/usr.bin/make/parse.c:1.339
--- src/usr.bin/make/parse.c:1.338	Sun Sep 27 21:35:16 2020
+++ src/usr.bin/make/parse.c	Mon Sep 28 01:24:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.338 2020/09/27 21:35:16 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.339 2020/09/28 01:24:34 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -132,7 +132,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.338 2020/09/27 21:35:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.339 2020/09/28 01:24:34 sjg Exp $");
 
 /* types and constants */
 
@@ -777,7 +777,9 @@ ParseMessage(char *line)
     free(line);
 
     if (mtype == PARSE_FATAL) {
-	/* Terminate immediately. */
+	/* Terminate almost immediately. */
+	dieQuietly(NULL, 0);
+	PrintOnError(NULL, NULL);
 	exit(1);
     }
     return TRUE;
@@ -3052,6 +3054,7 @@ Parse_File(const char *name, int fd)
 	(void)fprintf(stderr,
 	    "%s: Fatal errors encountered -- cannot continue",
 	    progname);
+	dieQuietly(NULL, 0);
 	PrintOnError(NULL, NULL);
 	exit(1);
     }

Index: src/usr.bin/make/unit-tests/error.exp
diff -u src/usr.bin/make/unit-tests/error.exp:1.1 src/usr.bin/make/unit-tests/error.exp:1.2
--- src/usr.bin/make/unit-tests/error.exp:1.1	Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/error.exp	Mon Sep 28 01:24:34 2020
@@ -1,4 +1,6 @@
 make: "error.mk" line 3: just FYI
 make: "error.mk" line 4: warning: this could be serious
 make: "error.mk" line 5: this is fatal
+
+make: stopped in unit-tests
 exit status 1

Reply via email to