aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-26 21:01:48 +0000
committerMiles Bader <miles@gnu.org>1996-07-26 21:01:48 +0000
commitd4eaba51e77c56a64525896723991aaa033c74f3 (patch)
tree00fd0112857bc2489aa3a44ea2c4b35caeef132a
parentFri Jul 26 00:36:50 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> (diff)
downloadglibc-d4eaba51e77c56a64525896723991aaa033c74f3.tar.gz
glibc-d4eaba51e77c56a64525896723991aaa033c74f3.tar.bz2
glibc-d4eaba51e77c56a64525896723991aaa033c74f3.zip
(getutid_r): Mark UTMP_DATA->loc_utmp invalid if a search fails.
-rw-r--r--login/getutid_r.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/login/getutid_r.c b/login/getutid_r.c
index 347bbf3a86..73bcb3d9c0 100644
--- a/login/getutid_r.c
+++ b/login/getutid_r.c
@@ -65,6 +65,7 @@ getutid_r (const struct utmp *id, struct utmp **utmp,
if (read (utmp_data->ut_fd, &utmp_data->ubuf, sizeof (struct utmp))
!= sizeof (struct utmp))
{
+ utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
errno = ESRCH;
return -1;
}
@@ -87,6 +88,7 @@ getutid_r (const struct utmp *id, struct utmp **utmp,
if (read (utmp_data->ut_fd, &utmp_data->ubuf, sizeof (struct utmp))
!= sizeof (struct utmp))
{
+ utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
errno = ESRCH;
return -1;
}