From 49b986270035c7f86c3dc85383fd1da2e413fef9 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 18 Jul 1996 08:43:26 +0000 Subject: Thu Jul 18 04:33:21 1996 Roland McGrath * sysdeps/mach/hurd/errnos.awk: Move EWOULDBLOCK check before errno==0 check. mib's clueless hacking broke it. Thu Jul 18 04:27:21 1996 Roland McGrath * Makerules ($(libdir)/libc.so): Add missing / after $(cryptobjdir). Wed Jul 17 10:54:20 1996 David Mosberger-Tang * sysdeps/unix/sysv/linux/alpha/start.S: Move to ... * sysdeps/alpha/elf/start.S: here. * misc/sys/ustat.h: New file. * misc/ustat.h: Ditto. * sysdeps/generic/ustatbits.h: Ditto. * libc-orig/sysdeps/stub/ustat.c: Ditto. * sysdeps/unix/sysv/linux/ustatbits.h: Ditto. * misc/Makefile (headers): Mention ustat.h, sys/ustat.h, and ustatbits.h. (routines): Mention ustat. * sysdeps/unix/sysv/linux/syscalls.list: Mention klogctl in alphabetically correct place. Mention ustat. * sysdeps/unix/alpha/sysdep.S: Make errno a bss symbol, not a common symbol (makes errno accessible from gdb). * login/pututline_r.c (pututline_r): Test ut_id in repositioning test, not ut_type. * login/logwtmp.c (logwtmp): Reimplemented. Must ensure that a record always gets appended at end of file (wtmp is a log file, after all). Set ut_type to DEAD_PROCESS if name is empty. * login/getutid_r.c (getutid_r): Handle search for UT_TYPE in separate loop from search for UT_ID. Fix code so it is in sync with Unix man page. * login/getutline_r.c (getutline_r): Stop searching only if ut_line matches and type is either USER_PROCESS or LOGIN_PROCESS. Tue Jul 16 15:06:18 1996 David Mosberger-Tang * sysdeps/unix/sysv/linux/netinet/in.h: Base on to avoid duplicate declarations. Sun Jul 14 19:08:55 1996 David Mosberger-Tang * manual/maint.texi (Supported Configurations): Add alpha-gnu-linux and alpha-gnu-linuxecoff targets. Fri Jul 12 16:58:44 1996 David Mosberger-Tang * sysdeps/unix/sysv/linux/netinet/in.h: Declare bindresvport(). Sat Jun 22 23:30:07 1996 David Mosberger-Tang * resolv/res_send.c (res_send): Declare FROMLEN as size_t instead of int. * resolv/res_comp.c (res_hnok): Use empty statement in place of NULL (which generates a "useless expression" warning in gcc). --- login/getutline_r.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'login/getutline_r.c') diff --git a/login/getutline_r.c b/login/getutline_r.c index 965d46ce8f..4d3547181f 100644 --- a/login/getutline_r.c +++ b/login/getutline_r.c @@ -55,22 +55,16 @@ getutline_r (const struct utmp *line, struct utmp **utmp, /* Update position pointer. */ utmp_data->loc_utmp += sizeof (struct utmp); + if ( #if _HAVE_UT_TYPE - 0 - if (utmp_data->ubuf.ut_type == USER_PROCESS - && strncmp (line->ut_line, utmp_data->ubuf.ut_line, - sizeof line->ut_line) == 0) - /* Stop if we found an user entry. */ - break; - - if (utmp_data->ubuf.ut_type == LOGIN_PROCESS) - /* Stop if we found a login entry. */ - break; -#else /* !_HAVE_UT_TYPE */ - if (strncmp (line->ut_line, utmp_data->ubuf.ut_line, - sizeof line->ut_line) == 0) - /* Stop if the line match. */ - break; + (utmp_data->ubuf.ut_type == USER_PROCESS + || utmp_data->ubuf.ut_type == LOGIN_PROCESS) + && #endif + ! strncmp (line->ut_line, utmp_data->ubuf.ut_line, + sizeof line->ut_line)) + /* Stop if we found a user or login entry. */ + break; } *utmp = &utmp_data->ubuf; -- cgit v1.2.3