Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): add comments for strange error handlin...



details:   https://anonhg.NetBSD.org/src/rev/ec6558475f83
branches:  trunk
changeset: 979096:ec6558475f83
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 13 16:47:19 2020 +0000

description:
make(1): add comments for strange error handling in Compat_Run

diffstat:

 usr.bin/make/compat.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 5c6939297200 -r ec6558475f83 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sun Dec 13 16:32:57 2020 +0000
+++ b/usr.bin/make/compat.c     Sun Dec 13 16:47:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.211 2020/12/13 16:32:57 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.212 2020/12/13 16:47:19 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.211 2020/12/13 16:32:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.212 2020/12/13 16:47:19 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -728,8 +728,10 @@
                        printf("`%s' not remade because of errors.\n",
                               gn->name);
                }
-               if (GNode_IsError(gn))
+               if (GNode_IsError(gn)) {
                        seenError = TRUE;
+                       /* XXX: In case of error, set the error node. */
+               }
        }
 
        /* If the user has defined a .END target, run its commands. */
@@ -737,9 +739,14 @@
                GNode *endNode = Targ_GetEndNode();
                Compat_Make(endNode, endNode);
                seenError = GNode_IsError(endNode);
+               /* XXX: In case of error, set the error node. */
        }
 
        if (seenError) {
+               /*
+                * XXX: Instead of gn, it makes more sense to report the
+                * first error node.
+                */
                PrintOnError(gn, "\nStop.");
                exit(1);
        }



Home | Main Index | Thread Index | Old Index