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): invert condition in Job_CheckCommands,...



details:   https://anonhg.NetBSD.org/src/rev/adebc15dac7a
branches:  trunk
changeset: 941653:adebc15dac7a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 25 20:19:06 2020 +0000

description:
make(1): invert condition in Job_CheckCommands, reduce indentation

diffstat:

 usr.bin/make/job.c |  66 +++++++++++++++++++++++++++--------------------------
 1 files changed, 34 insertions(+), 32 deletions(-)

diffs (90 lines):

diff -r b555df934e24 -r adebc15dac7a usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun Oct 25 20:15:56 2020 +0000
+++ b/usr.bin/make/job.c        Sun Oct 25 20:19:06 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.281 2020/10/25 20:15:56 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.282 2020/10/25 20:19:06 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.281 2020/10/25 20:15:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.282 2020/10/25 20:19:06 rillig Exp $");
 
 # define STATIC static
 
@@ -1208,39 +1208,41 @@
        return TRUE;
     }
 
-    if (Dir_MTime(gn, 0) == 0 && (gn->type & OP_SPECIAL) == 0) {
-       /*
-        * The node wasn't the target of an operator.  We have no .DEFAULT
-        * rule to go on and the target doesn't already exist. There's
-        * nothing more we can do for this branch. If the -k flag wasn't
-        * given, we stop in our tracks, otherwise we just don't update
-        * this node's parents so they never get examined.
-        */
+    if (Dir_MTime(gn, 0) != 0 || (gn->type & OP_SPECIAL))
+       return TRUE;
 
-       if (gn->flags & FROM_DEPEND) {
-           if (!Job_RunTarget(".STALE", gn->fname))
-               fprintf(stdout, "%s: %s, %d: ignoring stale %s for %s\n",
-                       progname, gn->fname, gn->lineno, makeDependfile,
-                       gn->name);
-           return TRUE;
-       }
+    /*
+     * The node wasn't the target of an operator.  We have no .DEFAULT
+     * rule to go on and the target doesn't already exist. There's
+     * nothing more we can do for this branch. If the -k flag wasn't
+     * given, we stop in our tracks, otherwise we just don't update
+     * this node's parents so they never get examined.
+     */
 
-       if (gn->type & OP_OPTIONAL) {
-           (void)fprintf(stdout, "%s: don't know how to make %s (%s)\n",
-                         progname, gn->name, "ignored");
-           (void)fflush(stdout);
-       } else if (keepgoing) {
-           (void)fprintf(stdout, "%s: don't know how to make %s (%s)\n",
-                         progname, gn->name, "continuing");
-           (void)fflush(stdout);
-           return FALSE;
-       } else {
-           abortProc("%s: don't know how to make %s. Stop",
-                     progname, gn->name);
-           return FALSE;
-       }
+    if (gn->flags & FROM_DEPEND) {
+       if (!Job_RunTarget(".STALE", gn->fname))
+           fprintf(stdout, "%s: %s, %d: ignoring stale %s for %s\n",
+                   progname, gn->fname, gn->lineno, makeDependfile,
+                   gn->name);
+       return TRUE;
     }
-    return TRUE;
+
+    if (gn->type & OP_OPTIONAL) {
+       (void)fprintf(stdout, "%s: don't know how to make %s (%s)\n",
+                     progname, gn->name, "ignored");
+       (void)fflush(stdout);
+       return TRUE;
+    }
+
+    if (keepgoing) {
+       (void)fprintf(stdout, "%s: don't know how to make %s (%s)\n",
+                     progname, gn->name, "continuing");
+       (void)fflush(stdout);
+       return FALSE;
+    }
+
+    abortProc("%s: don't know how to make %s. Stop", progname, gn->name);
+    return FALSE;
 }
 
 /* Execute the shell for the given job. Called from JobStart



Home | Main Index | Thread Index | Old Index