Module Name: src
Committed By: rillig
Date: Sat Mar 8 20:15:03 UTC 2025
Modified Files:
src/usr.bin/make: job.c
Log Message:
make: re-add cast for pid_t -1
POSIX only specifies that pid_t is an arithmetic type, it doesn't even
have to be an integer type. Just in case a platform defines pid_t as an
unsigned integer type, avoid a compiler warning about passing a negative
constant to an unsigned target type.
Such a platform is probably rare, as Job.pid is declared as int, not
pid_t, so there would be more compiler warnings of this kind on such a
platform.
To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 src/usr.bin/make/job.c
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.488 src/usr.bin/make/job.c:1.489
--- src/usr.bin/make/job.c:1.488 Fri Mar 7 16:41:21 2025
+++ src/usr.bin/make/job.c Sat Mar 8 20:15:03 2025
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.488 2025/03/07 16:41:21 rillig Exp $ */
+/* $NetBSD: job.c,v 1.489 2025/03/08 20:15:03 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.488 2025/03/07 16:41:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.489 2025/03/08 20:15:03 rillig Exp $");
/*
* A shell defines how the commands are run. All commands for a target are
@@ -2524,7 +2524,7 @@ Job_AbortAll(void)
}
}
- while (waitpid(-1, &status, WNOHANG) > 0)
+ while (waitpid((pid_t)-1, &status, WNOHANG) > 0)
continue;
}