From d4eaba51e77c56a64525896723991aaa033c74f3 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 26 Jul 1996 21:01:48 +0000 Subject: (getutid_r): Mark UTMP_DATA->loc_utmp invalid if a search fails. --- login/getutid_r.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'login/getutid_r.c') 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; } -- cgit v1.2.3