summaryrefslogtreecommitdiffstats
path: root/osdep-freebsd.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-07-28 22:28:11 +0000
committerTiago Cunha <tcunha@gmx.com>2009-07-28 22:28:11 +0000
commit2dda19798023102cc6cd41a3641645d6eba78795 (patch)
tree481d2c98bf822da0a9f9cbaad306e64f76a6df9e /osdep-freebsd.c
parent6043d9cf89ab96a2bd4f8e910ea72243ef91e044 (diff)
Make similar changes to the OS-dependent code for FreeBSD, and NetBSD in
accordance to OpenBSD patchset 182.
Diffstat (limited to 'osdep-freebsd.c')
-rw-r--r--osdep-freebsd.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/osdep-freebsd.c b/osdep-freebsd.c
index 3c67c779..45b9f435 100644
--- a/osdep-freebsd.c
+++ b/osdep-freebsd.c
@@ -1,4 +1,4 @@
-/* $Id: osdep-freebsd.c,v 1.16 2009-06-26 15:31:15 nicm Exp $ */
+/* $Id: osdep-freebsd.c,v 1.17 2009-07-28 22:28:11 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -85,29 +85,34 @@ retry:
continue;
}
- if (is_runnable(p) && !is_runnable(bestp))
+ if (is_runnable(p) && !is_runnable(bestp)) {
bestp = p;
- else if (!is_runnable(p) && is_runnable(bestp))
+ continue;
+ } else if (!is_runnable(p) && is_runnable(bestp))
continue;
- if (!is_stopped(p) && is_stopped(bestp))
+ if (!is_stopped(p) && is_stopped(bestp)) {
bestp = p;
- else if (is_stopped(p) && !is_stopped(bestp))
+ continue;
+ } else if (is_stopped(p) && !is_stopped(bestp))
continue;
- if (p->ki_estcpu > bestp->ki_estcpu)
+ if (p->ki_estcpu > bestp->ki_estcpu) {
bestp = p;
- else if (p->ki_estcpu < bestp->ki_estcpu)
+ continue;
+ } else if (p->ki_estcpu < bestp->ki_estcpu)
continue;
- if (p->ki_slptime < bestp->ki_slptime)
+ if (p->ki_slptime < bestp->ki_slptime) {
bestp = p;
- else if (p->ki_slptime > bestp->ki_slptime)
+ continue;
+ } else if (p->ki_slptime > bestp->ki_slptime)
continue;
- if (strcmp(p->ki_comm, p->ki_comm) < 0)
+ if (strcmp(p->ki_comm, bestp->ki_comm) < 0) {
bestp = p;
- else if (strcmp(p->ki_comm, p->ki_comm) > 0)
+ continue;
+ } else if (strcmp(p->ki_comm, bestp->ki_comm) > 0)
continue;
if (p->ki_pid > bestp->ki_pid)