Module Name:    src
Committed By:   rillig
Date:           Sat Nov  7 21:24:33 UTC 2020

Modified Files:
        src/usr.bin/make: job.c job.h

Log Message:
make(1): fix type of Job.suspended


To generate a diff of this commit:
cvs rdiff -u -r1.309 -r1.310 src/usr.bin/make/job.c
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/make/job.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.309 src/usr.bin/make/job.c:1.310
--- src/usr.bin/make/job.c:1.309	Sat Nov  7 20:03:56 2020
+++ src/usr.bin/make/job.c	Sat Nov  7 21:24:33 2020
@@ -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 @@ JobReapChild(pid_t pid, int status, Bool
 		(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 @@ JobRestartJobs(void)
 
     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);
 	    }

Index: src/usr.bin/make/job.h
diff -u src/usr.bin/make/job.h:1.59 src/usr.bin/make/job.h:1.60
--- src/usr.bin/make/job.h:1.59	Sat Nov  7 20:03:56 2020
+++ src/usr.bin/make/job.h	Sat Nov  7 21:24:33 2020
@@ -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 @@ struct pollfd;
 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 @@ typedef struct Job {
 
     JobState job_state;		/* status of the job entry */
 
-    char job_suspended;
+    Boolean suspended;
 
     JobFlags flags;		/* Flags to control treatment of job */
 

Reply via email to