[php-src] PHP-8.2: Use return value of getpwuid_r(), not errno (#13969)
| From: | Arnaud Le Blanc via GitHub | Date: | Tue, 16 Apr 2024 12:08:35 +0000 |
| Subject: | [php-src] PHP-8.2: Use return value of getpwuid_r(), not errno (#13969) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-128132@lists.php.net to get a copy of this message | ||
Author: Arnaud Le Blanc (arnaud-lb)
Committer: GitHub (web-flow)
Pusher: arnaud-lb
Date: 2024-04-16T14:08:28+02:00
Commit: https://github.com/php/php-src/commit/32efc76c327fc8e968a34b327f7ce5b2e205070e
Raw diff: https://github.com/php/php-src/commit/32efc76c327fc8e968a34b327f7ce5b2e205070e.diff
Use return value of getpwuid_r(), not errno (#13969)
Changed paths:
M ext/posix/posix.c
Diff:
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index e5ab4b5940a55..dbc888a7ea697 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -952,7 +952,7 @@ PHP_FUNCTION(posix_getpwuid)
try_again:
err = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
if (err || retpwptr == NULL) {
- if (errno == ERANGE) {
+ if (err == ERANGE) {
pwbuflen *= 2;
pwbuf = erealloc(pwbuf, pwbuflen);
goto try_again;