[php-src] master: ext/pcntl: getpriority/setpriority `who` default value handling change. (#13911)
| From: | David CARLIER via GitHub | Date: | Sun, 07 Apr 2024 21:30:54 +0000 |
| Subject: | [php-src] master: ext/pcntl: getpriority/setpriority `who` default value handling change. (#13911) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127976@lists.php.net to get a copy of this message | ||
Author: David CARLIER (devnexen)
Committer: GitHub (web-flow)
Pusher: devnexen
Date: 2024-04-07T22:30:48+01:00
Commit: https://github.com/php/php-src/commit/7c860628cd2bf11ee867bfb41b3fd0314c5177c5
Raw diff: https://github.com/php/php-src/commit/7c860628cd2bf11ee867bfb41b3fd0314c5177c5.diff
ext/pcntl: getpriority/setpriority
who default value handling change. (#13911)
0 refers to the calling process, all across unixes, thus saving one
syscall.
Changed paths:
M ext/pcntl/pcntl.c
Diff:
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index da9af786b4ab..6ccfd71f9ab6 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -1014,7 +1014,7 @@ PHP_FUNCTION(pcntl_getpriority)
/* needs to be cleared, since any returned value is valid */
errno = 0;
- pid = pid_is_null ? getpid() : pid;
+ pid = pid_is_null ? 0 : pid;
pri = getpriority(who, pid);
if (errno) {
@@ -1068,7 +1068,7 @@ PHP_FUNCTION(pcntl_setpriority)
Z_PARAM_LONG(who)
ZEND_PARSE_PARAMETERS_END();
- pid = pid_is_null ? getpid() : pid;
+ pid = pid_is_null ? 0 : pid;
if (setpriority(who, pid, pri)) {
PCNTL_G(last_error) = errno;