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/f9fcae4b54c2
branches:  trunk
changeset: 1014657:f9fcae4b54c2
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 6155ae98d210 -r f9fcae4b54c2 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 6155ae98d210 -r f9fcae4b54c2 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