mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix spurious errors in refactored passwd/group code
errno was treated as the error status when the return value of getline
was negative, but this condition can simply indicate EOF and is not
necessarily an error.
the spurious errors caused by this bug masked the bug which was fixed
in commit fc5a96c9c8
.
This commit is contained in:
parent
fc5a96c9c8
commit
0afef1aa24
2 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ int __getgrent_a(FILE *f, struct group *gr, char **line, size_t *size, char ***m
|
|||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
|
||||
for (;;) {
|
||||
if ((l=getline(line, size, f)) < 0) {
|
||||
rv = errno;
|
||||
rv = ferror(f) ? errno : 0;
|
||||
free(*line);
|
||||
*line = 0;
|
||||
gr = 0;
|
||||
|
|
|
@ -17,7 +17,7 @@ int __getpwent_a(FILE *f, struct passwd *pw, char **line, size_t *size, struct p
|
|||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
|
||||
for (;;) {
|
||||
if ((l=getline(line, size, f)) < 0) {
|
||||
rv = errno;
|
||||
rv = ferror(f) ? errno : 0;
|
||||
free(*line);
|
||||
*line = 0;
|
||||
pw = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue