Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Ensure that parse errors report 'stopped in'



details:   https://anonhg.NetBSD.org/src/rev/b7d1ad78d30a
branches:  trunk
changeset: 944410:b7d1ad78d30a
user:      sjg <sjg%NetBSD.org@localhost>
date:      Mon Sep 28 01:24:34 2020 +0000

description:
Ensure that parse errors report 'stopped in'

diffstat:

 usr.bin/make/parse.c              |  9 ++++++---
 usr.bin/make/unit-tests/error.exp |  2 ++
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 322c38508c5b -r b7d1ad78d30a usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Mon Sep 28 01:20:29 2020 +0000
+++ b/usr.bin/make/parse.c      Mon Sep 28 01:24:34 2020 +0000
@@ -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 @@
     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 @@
        (void)fprintf(stderr,
            "%s: Fatal errors encountered -- cannot continue",
            progname);
+       dieQuietly(NULL, 0);
        PrintOnError(NULL, NULL);
        exit(1);
     }
diff -r 322c38508c5b -r b7d1ad78d30a usr.bin/make/unit-tests/error.exp
--- a/usr.bin/make/unit-tests/error.exp Mon Sep 28 01:20:29 2020 +0000
+++ b/usr.bin/make/unit-tests/error.exp Mon Sep 28 01:24:34 2020 +0000
@@ -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



Home | Main Index | Thread Index | Old Index