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: remove unnecessary assignment in Job_Star...



details:   https://anonhg.NetBSD.org/src/rev/e292b8db5951
branches:  trunk
changeset: 959223:e292b8db5951
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Feb 05 05:53:40 2021 +0000

description:
make: remove unnecessary assignment in Job_Start, clean up comments

diffstat:

 usr.bin/make/job.c |  20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diffs (55 lines):

diff -r 7a8157cca0e5 -r e292b8db5951 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Fri Feb 05 05:48:19 2021 +0000
+++ b/usr.bin/make/job.c        Fri Feb 05 05:53:40 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.417 2021/02/05 05:15:12 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.418 2021/02/05 05:53:40 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.417 2021/02/05 05:15:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.418 2021/02/05 05:53:40 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -1666,31 +1666,25 @@
            (!opts.noExecute && !opts.touchFlag)) {
                /*
                 * The above condition looks very similar to
-                * GNode_ShouldExecute but is subtly different.
-                * It prevents that .MAKE targets are touched.
+                * GNode_ShouldExecute but is subtly different.  It prevents
+                * that .MAKE targets are touched since these are usually
+                * virtual targets.
                 */
 
                JobWriteShellCommands(job, gn, cmdsOK, &run);
                (void)fflush(job->cmdFILE);
        } else if (!GNode_ShouldExecute(gn)) {
                /*
-                * Not executing anything -- just print all the commands to
-                * stdout in one fell swoop. This will still set up
-                * job->tailCmds correctly.
+                * Just print all the commands to stdout in one fell swoop.
+                * This still sets up job->tailCmds correctly.
                 */
                SwitchOutputTo(gn);
                job->cmdFILE = stdout;
                if (cmdsOK)
                        JobPrintCommands(job);
-               /* Don't execute the shell, thank you. */
                run = FALSE;
                (void)fflush(job->cmdFILE);
        } else {
-               /*
-                * Just touch the target and note that no shell should be
-                * executed. Set cmdFILE to stdout to make life easier.
-                */
-               job->cmdFILE = stdout;
                Job_Touch(gn, job->echo);
                run = FALSE;
        }



Home | Main Index | Thread Index | Old Index