changeset 5931:673d533b0778

(desirable_utmp_entry): Fix bug where "who -b" and "who -r" failed to give output.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 22 Jun 2005 18:27:44 +0000
parents d3f94dc03257
children 8ef7d6084536
files lib/ChangeLog lib/readutmp.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,8 @@
 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
 
+	* readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
+	"who -r" failed to give output.  Problem reported by Tim Waugh.
+
 	* xmalloc.c (HAVE_GNU_CALLOC): New constant.
 	(xcalloc): Use it to avoid needless tests.
 	Problem reported by Jim Meyering.
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -68,6 +68,7 @@
 desirable_utmp_entry (STRUCT_UTMP const *u, int options)
 {
   return ! (options & READ_UTMP_CHECK_PIDS
+	    && IS_USER_PROCESS (u)
 	    && (UT_PID (u) <= 0
 		|| (kill (UT_PID (u), 0) < 0 && errno == ESRCH)));
 }