summaryrefslogtreecommitdiff
path: root/grp/fgetgrent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-07 20:17:36 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-07 20:17:36 +0000
commitdb873f322bdefd03e68e7196277aee44fc021791 (patch)
tree5bec02675f8b6fc1cfd729e2518ab620561c007b /grp/fgetgrent_r.c
parent15828e9d787fc2ff5d9bb277765bf6666f1563c3 (diff)
Update.
1999-06-07 Ulrich Drepper <drepper@cygnus.com> * grp/fgetgrent.c (fgetgrent): Remember position of stream before reading and reset in case the buffer was too small. * grp/fgetgrent_r.c (__fgetgrent_r): Set errno to ENOENT in case of EOF.
Diffstat (limited to 'grp/fgetgrent_r.c')
-rw-r--r--grp/fgetgrent_r.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/grp/fgetgrent_r.c b/grp/fgetgrent_r.c
index 4abadfd569..0b1d782586 100644
--- a/grp/fgetgrent_r.c
+++ b/grp/fgetgrent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -74,13 +74,15 @@ __fgetgrent_r (FILE *stream, struct group *resbuf, char *buffer, size_t buflen,
{
funlockfile (stream);
*result = NULL;
+ __set_errno (ENOENT);
return errno;
}
if (p == NULL || buffer[buflen - 1] != '\xff')
{
funlockfile (stream);
*result = NULL;
- return errno = ERANGE;
+ __set_errno (ERANGE);
+ return errno;
}
/* Skip leading blanks. */