summaryrefslogtreecommitdiff
path: root/src/passwd/getpwent_a.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/passwd/getpwent_a.c')
-rw-r--r--src/passwd/getpwent_a.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passwd/getpwent_a.c b/src/passwd/getpwent_a.c
index 4d84f0d5..d1b4b53c 100644
--- a/src/passwd/getpwent_a.c
+++ b/src/passwd/getpwent_a.c
@@ -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;