summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/readutmp.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0874c81464..dea1f86675 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-05 Mats Erik Andersson <gnu@gisladisker.se> (tiny change)
+
+ readutmp: fix non-portable UT_PID use
+ * lib/readutmp.c (desirable_utmp_entry) <READ_UTMP_CHECK_PIDS>:
+ Use `UT_PID (u) > 0' as absolute condition.
+
2012-09-04 Jim Meyering <meyering@redhat.com>
fts: reduce two or more trailing spaces to just one, usually
diff --git a/lib/readutmp.c b/lib/readutmp.c
index f89dd68fe6..ef6277a680 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -69,8 +69,8 @@ desirable_utmp_entry (STRUCT_UTMP const *u, int options)
return false;
if ((options & READ_UTMP_CHECK_PIDS)
&& user_proc
- && (UT_PID (u) <= 0
- || (kill (UT_PID (u), 0) < 0 && errno == ESRCH)))
+ && 0 < UT_PID (u)
+ && (kill (UT_PID (u), 0) < 0 && errno == ESRCH))
return false;
return true;
}