summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-06-22 18:26:22 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-06-22 18:26:22 +0000
commit956daabfc622916858b9e11e6b724c5fc5c07d62 (patch)
treea3c71b89c9557c0a7b7e32efdaaf75d5b956705e /lib
parent070e3b128034dd042ab8c5e8c2a2caa791db1f02 (diff)
downloadcoreutils-956daabfc622916858b9e11e6b724c5fc5c07d62.tar.xz
(desirable_utmp_entry): Fix bug where "who -b" and "who -r"
failed to give output.
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/readutmp.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index d81d87552..a5a50436f 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +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.
+
2005-06-22 Jim Meyering <jim@meyering.net>
* xmalloc.c: Update from gnulib.
diff --git a/lib/readutmp.c b/lib/readutmp.c
index ca4472c65..846ab3c6a 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -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)));
}