(desirable_utmp_entry): Fix bug where "who -b" and "who -r"
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 22 Jun 2005 18:27:44 +0000 (18:27 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 22 Jun 2005 18:27:44 +0000 (18:27 +0000)
failed to give output.

lib/ChangeLog
lib/readutmp.c

index cffd88e..3dd4580 100644 (file)
@@ -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.
index ca4472c..846ab3c 100644 (file)
@@ -68,6 +68,7 @@ static inline bool
 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)));
 }