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:
parent
ce15b8405e
commit
a064166bd2
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user