Handle ERANGE error correctly
The reentrant functions getgrgid_r, getgrnam_r, getpwnam_r, etc. all return an error code instead of setting errno. Adapt the error check accordingly.
This commit is contained in:
parent
57cd14f194
commit
e9bf727253
@ -66,7 +66,6 @@
|
||||
"x" STRINGIZE(FUNCTION_NAME));
|
||||
exit (13);
|
||||
}
|
||||
errno = 0;
|
||||
status = REENTRANT_NAME(ARG_NAME, result, buffer,
|
||||
length, &resbuf);
|
||||
if ((0 == status) && (resbuf == result)) {
|
||||
@ -78,7 +77,7 @@
|
||||
return ret_result;
|
||||
}
|
||||
|
||||
if (ERANGE != errno) {
|
||||
if (ERANGE != status) {
|
||||
free (buffer);
|
||||
free (result);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user