Module Name: src
Committed By: rin
Date: Mon Dec 26 20:52:39 UTC 2016
Modified Files:
src/bin/ps: ps.c
Log Message:
simplify logic; there must be no CPU usage when p_swtime is zero
To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/ps/ps.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/ps/ps.c
diff -u src/bin/ps/ps.c:1.87 src/bin/ps/ps.c:1.88
--- src/bin/ps/ps.c:1.87 Fri Dec 2 21:59:03 2016
+++ src/bin/ps/ps.c Mon Dec 26 20:52:39 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ps.c,v 1.87 2016/12/02 21:59:03 christos Exp $ */
+/* $NetBSD: ps.c,v 1.88 2016/12/26 20:52:39 rin Exp $ */
/*
* Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-__RCSID("$NetBSD: ps.c,v 1.87 2016/12/02 21:59:03 christos Exp $");
+__RCSID("$NetBSD: ps.c,v 1.88 2016/12/26 20:52:39 rin Exp $");
#endif
#endif /* not lint */
@@ -611,8 +611,7 @@ setpinfo(struct kinfo_proc2 *ki, int nen
pi[i].ki = &ki[i];
if (!calc_pcpu)
continue;
- if (ki[i].p_realstat == SZOMB ||
- (!rawcpu && ki[i].p_swtime == 0)) {
+ if (ki[i].p_swtime == 0 || ki[i].p_realstat == SZOMB) {
pi[i].pcpu = 0.0;
continue;
}