summaryrefslogtreecommitdiffstats
path: root/Modules/_posixsubprocess.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-27 13:05:35 (GMT)
committerGitHub <noreply@github.com>2022-05-27 13:05:35 (GMT)
commit22b75d9bef1bffe82bfa1adfcbec0243c9202041 (patch)
tree2f2670227cb3db6e5209b1586c79d5ffa45145fd /Modules/_posixsubprocess.c
parentcb04a09d2dfd197436a11de504b92773569e19fb (diff)
downloadcpython-22b75d9bef1bffe82bfa1adfcbec0243c9202041.zip
cpython-22b75d9bef1bffe82bfa1adfcbec0243c9202041.tar.gz
cpython-22b75d9bef1bffe82bfa1adfcbec0243c9202041.tar.bz2
gh-82616: Add Py_IS_TYPE_SIGNED() macro (#93178)
_posixsubprocess: add a static assertion to ensure that the pid_t type is signed. Replace _Py_IntegralTypeSigned() with _Py_IS_TYPE_SIGNED().
Diffstat (limited to 'Modules/_posixsubprocess.c')
-rw-r--r--Modules/_posixsubprocess.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 9132f13..44e60d7 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -612,8 +612,10 @@ child_exec(char *const exec_array[],
#endif
#ifdef HAVE_SETPGID
- if (pgid_to_set >= 0)
+ static_assert(_Py_IS_TYPE_SIGNED(pid_t), "pid_t is unsigned");
+ if (pgid_to_set >= 0) {
POSIX_CALL(setpgid(0, pgid_to_set));
+ }
#endif
#ifdef HAVE_SETGROUPS