summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2004-04-14 09:34:17 +0000
committerbde <bde@FreeBSD.org>2004-04-14 09:34:17 +0000
commitb07f071cf069dcf6f3084534da623de2f261bef8 (patch)
tree4f2a1a3a61bd6de4d885988d4330bdab5590535b /usr.bin
parent253d68a52ad8522745b927b6c947091bdb4020c8 (diff)
downloadFreeBSD-src-b07f071cf069dcf6f3084534da623de2f261bef8.zip
FreeBSD-src-b07f071cf069dcf6f3084534da623de2f261bef8.tar.gz
Include <sys/proc.h> instead of depending on namespace pollution in
<sys/user.h> for the definition of TDF_SINTR. Fixed anachronous spelling of TDF_SINTR in a comment Demangled VCS ids. There were 2 misplaced copies of $FreeBSD$ and of the include before it. The vendor id infrastructure was edited. Fixed the only other remaining style bug since rev.1.1 (expansion of struct member names made a line too long).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/w/proc_compare.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/w/proc_compare.c b/usr.bin/w/proc_compare.c
index 62ff0d2..8e807d1 100644
--- a/usr.bin/w/proc_compare.c
+++ b/usr.bin/w/proc_compare.c
@@ -31,15 +31,17 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
+#if 0
#ifndef lint
-static const char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
+static char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
+#endif /* not lint */
#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
+#include <sys/proc.h>
#include <sys/time.h>
#include <sys/user.h>
@@ -55,7 +57,7 @@ static const char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
* with the highest cpu utilization is picked (p_estcpu). Ties are
* broken by picking the highest pid.
* 3) The sleeper with the shortest sleep time is next. With ties,
- * we pick out just "short-term" sleepers (PS_SINTR == 0).
+ * we pick out just "short-term" sleepers (TDF_SINTR == 0).
* 4) Further ties are broken by picking the highest pid.
*
* If you change this, be sure to consider making the change in the kernel
@@ -64,10 +66,6 @@ static const char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
* TODO - consider whether pctcpu should be used.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
#define ISRUN(p) (((p)->ki_stat == SRUN) || ((p)->ki_stat == SIDL))
#define TESTAB(a, b) ((a)<<1 | (b))
#define ONLYA 2
@@ -96,7 +94,7 @@ proc_compare(struct kinfo_proc *p1, struct kinfo_proc *p2)
return (1);
if (p1->ki_estcpu > p2->ki_estcpu)
return (0);
- return (p2->ki_pid > p1->ki_pid); /* tie - return highest pid */
+ return (p2->ki_pid > p1->ki_pid); /* tie - return highest pid */
}
/*
* weed out zombies
OpenPOWER on IntegriCloud