From 25081385321fe69b1a7cfc4640e15011cd201621 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Thu, 4 Apr 2024 21:05:35 +0100 Subject: [PATCH] ext/pcntl: pcnt_setns few nitpicks changes. (#13885) --- ext/pcntl/pcntl.c | 4 ++-- ext/pcntl/pcntl.stub.php | 2 +- ext/pcntl/pcntl_arginfo.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b19edb0ddb9..4c4d01c27ce 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1428,7 +1428,7 @@ PHP_FUNCTION(pcntl_setns) switch (errno) { case EINVAL: case ESRCH: - zend_argument_value_error(1, "is not a valid process (%d)", pid); + zend_argument_value_error(1, "is not a valid process (" ZEND_LONG_FMT ")", pid); RETURN_THROWS(); case ENFILE: @@ -1455,7 +1455,7 @@ PHP_FUNCTION(pcntl_setns) PCNTL_G(last_error) = errno; switch (errno) { case ESRCH: - zend_argument_value_error(1, "process no longer available (%d)", pid); + zend_argument_value_error(1, "process no longer available (" ZEND_LONG_FMT ")", pid); RETURN_THROWS(); case EINVAL: diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 09e318307d0..a2420f33523 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -992,5 +992,5 @@ function pcntl_forkx(int $flags): int{} #endif #ifdef HAVE_PIDFD_OPEN -function pcntl_setns(int $process_id = null, int $nstype = CLONE_NEWNET): bool {} +function pcntl_setns(?int $process_id = null, int $nstype = CLONE_NEWNET): bool {} #endif diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index c86c1d815b5..cd16e4f19cd 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 614bd67bb4cfcdc68d37141ff9dfad0a49c318b5 */ + * Stub hash: e5204cee68c41ff1201992f2572940c8f87980a3 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -134,7 +134,7 @@ ZEND_END_ARG_INFO() #if defined(HAVE_PIDFD_OPEN) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_setns, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_id, IS_LONG, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_id, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nstype, IS_LONG, 0, "CLONE_NEWNET") ZEND_END_ARG_INFO() #endif