From: Miles Bader Date: Fri, 26 Jul 1996 21:01:48 +0000 (+0000) Subject: (getutid_r): Mark UTMP_DATA->loc_utmp invalid if a search fails. X-Git-Tag: upstream/2.30~29195 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4eaba51e77c56a64525896723991aaa033c74f3;p=external%2Fglibc.git (getutid_r): Mark UTMP_DATA->loc_utmp invalid if a search fails. --- diff --git a/login/getutid_r.c b/login/getutid_r.c index 347bbf3..73bcb3d 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; }