(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 cffd88ee0531f189d01b922a6c0cad4486b97e88..3dd4580aa242debe0b4fd409c766b682c31daefb 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 ca4472c650a2994c06693678e3b1c39d608bf59c..846ab3c6a2da7103752ec757a18172697f880384 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)));
 }