diff --git a/ext/posix/posix.c b/ext/posix/posix.c index e5ab4b5940a5..dbc888a7ea69 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;