unix,core: fix errno handling in uv__getpwuid_r

Fixes: https://github.com/libuv/libuv/issues/3174
PR-URL: https://github.com/libuv/libuv/pull/3177
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
This commit is contained in:
Darshan Sen 2021-05-22 01:57:22 +05:30 committed by GitHub
parent ce15b8405e
commit a064166bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1184,7 +1184,9 @@ int uv__getpwuid_r(uv_passwd_t* pwd) {
if (buf == NULL)
return UV_ENOMEM;
r = getpwuid_r(uid, &pw, buf, bufsize, &result);
do
r = getpwuid_r(uid, &pw, buf, bufsize, &result);
while (r == EINTR);
if (r != ERANGE)
break;
@ -1194,7 +1196,7 @@ int uv__getpwuid_r(uv_passwd_t* pwd) {
if (r != 0) {
uv__free(buf);
return -r;
return UV__ERR(r);
}
if (result == NULL) {