mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-29 16:21:07 +00:00
(getutid_r): Mark UTMP_DATA->loc_utmp invalid if a search fails.
This commit is contained in:
parent
fa8463e5ed
commit
d4eaba51e7
@ -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))
|
if (read (utmp_data->ut_fd, &utmp_data->ubuf, sizeof (struct utmp))
|
||||||
!= sizeof (struct utmp))
|
!= sizeof (struct utmp))
|
||||||
{
|
{
|
||||||
|
utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
|
||||||
errno = ESRCH;
|
errno = ESRCH;
|
||||||
return -1;
|
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))
|
if (read (utmp_data->ut_fd, &utmp_data->ubuf, sizeof (struct utmp))
|
||||||
!= sizeof (struct utmp))
|
!= sizeof (struct utmp))
|
||||||
{
|
{
|
||||||
|
utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
|
||||||
errno = ESRCH;
|
errno = ESRCH;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user