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): fix type of Job.suspended



details:   https://anonhg.NetBSD.org/src/rev/bfeb959c4684
branches:  trunk
changeset: 956787:bfeb959c4684
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 07 21:24:33 2020 +0000

description:
make(1): fix type of Job.suspended

diffstat:

 usr.bin/make/job.c |  12 ++++++------
 usr.bin/make/job.h |   5 +++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diffs (70 lines):

diff -r 95d0d1315a8a -r bfeb959c4684 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sat Nov 07 21:22:37 2020 +0000
+++ b/usr.bin/make/job.c        Sat Nov 07 21:24:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.309 2020/11/07 20:03:56 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.310 2020/11/07 21:24:33 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.309 2020/11/07 20:03:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.310 2020/11/07 21:24:33 rillig Exp $");
 
 /* A shell defines how the commands are run.  All commands for a target are
  * written into a single file, which is then given to the shell to execute
@@ -1959,7 +1959,7 @@
                (void)printf("*** [%s] Stopped -- signal %d\n",
                             job->node->name, WSTOPSIG(status));
            }
-           job->job_suspended = 1;
+           job->suspended = TRUE;
        }
        (void)fflush(stdout);
        return;
@@ -2568,13 +2568,13 @@
 
     for (job = job_table; job < job_table_end; job++) {
        if (job->job_state == JOB_ST_RUNNING &&
-               (make_suspended || job->job_suspended)) {
+               (make_suspended || job->suspended)) {
            DEBUG1(JOB, "Restarting stopped job pid %d.\n", job->pid);
-           if (job->job_suspended) {
+           if (job->suspended) {
                    (void)printf("*** [%s] Continued\n", job->node->name);
                    (void)fflush(stdout);
            }
-           job->job_suspended = 0;
+           job->suspended = FALSE;
            if (KILLPG(job->pid, SIGCONT) != 0 && DEBUG(JOB)) {
                debug_printf("Failed to send SIGCONT to %d\n", job->pid);
            }
diff -r 95d0d1315a8a -r bfeb959c4684 usr.bin/make/job.h
--- a/usr.bin/make/job.h        Sat Nov 07 21:22:37 2020 +0000
+++ b/usr.bin/make/job.h        Sat Nov 07 21:24:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.h,v 1.59 2020/11/07 20:03:56 rillig Exp $  */
+/*     $NetBSD: job.h,v 1.60 2020/11/07 21:24:33 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -120,6 +120,7 @@
 typedef enum JobState {
     JOB_ST_FREE =      0,      /* Job is available */
     JOB_ST_SETUP =     1,      /* Job is allocated but otherwise invalid */
+    /* XXX: What about the 2? */
     JOB_ST_RUNNING =   3,      /* Job is running, pid valid */
     JOB_ST_FINISHED =  4       /* Job is done (ie after SIGCHILD) */
 } JobState;
@@ -170,7 +171,7 @@
 
     JobState job_state;                /* status of the job entry */
 
-    char job_suspended;
+    Boolean suspended;
 
     JobFlags flags;            /* Flags to control treatment of job */
 



Home | Main Index | Thread Index | Old Index