mirror of
https://abf.rosa.ru/djam/coreutils.git
synced 2025-02-23 17:22:49 +00:00
25 lines
647 B
Diff
25 lines
647 B
Diff
![]() |
--- coreutils-8.3/lib/getugroups.c.groups 2010-01-04 17:19:05.000000000 +0100
|
||
|
+++ coreutils-8.3/lib/getugroups.c 2010-01-11 07:09:44.000000000 +0100
|
||
|
@@ -75,8 +75,12 @@
|
||
|
|
||
|
errno = 0;
|
||
|
grp = getgrent ();
|
||
|
- if (grp == NULL)
|
||
|
+ if (grp == NULL) {
|
||
|
+ if (errno == ENOENT)
|
||
|
+ /* expected at the end of the group list, so ignore errno */
|
||
|
+ errno =0;
|
||
|
break;
|
||
|
+ }
|
||
|
|
||
|
for (cp = grp->gr_mem; *cp; ++cp)
|
||
|
{
|
||
|
@@ -102,6 +106,7 @@
|
||
|
if (count == INT_MAX)
|
||
|
{
|
||
|
errno = EOVERFLOW;
|
||
|
+ count = -1;
|
||
|
goto done;
|
||
|
}
|
||
|
count++;
|