diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-02-07 19:24:50 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-02-07 19:24:50 +0000 |
commit | f53bcc87980c4a7dc85e62673c46ce67bb01de47 (patch) | |
tree | d6745d0f774c1d9fe65fa0804302e69288173437 | |
parent | 1d3fba86a3561c93cfbb42137c89fa85c65b0f2b (diff) | |
download | rtmux-f53bcc87980c4a7dc85e62673c46ce67bb01de47.tar.gz rtmux-f53bcc87980c4a7dc85e62673c46ce67bb01de47.tar.bz2 rtmux-f53bcc87980c4a7dc85e62673c46ce67bb01de47.zip |
Even better.
-rw-r--r-- | osdep-freebsd.c | 4 | ||||
-rw-r--r-- | osdep-openbsd.c | 21 |
2 files changed, 12 insertions, 13 deletions
diff --git a/osdep-freebsd.c b/osdep-freebsd.c index c7864e4b..66a9e48f 100644 --- a/osdep-freebsd.c +++ b/osdep-freebsd.c @@ -1,4 +1,4 @@ -/* $Id: osdep-freebsd.c,v 1.5 2009-02-07 19:16:25 nicm Exp $ */ +/* $Id: osdep-freebsd.c,v 1.6 2009-02-07 19:24:50 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -39,7 +39,7 @@ char *get_proc_argv0(pid_t); #define is_runnable(p) \ ((p)->ki_stat == SRUN || (p)->ki_stat == SIDL) #define is_stopped(p) \ - ((p)->ki_stat == SSTOP || (p)->ki_stat == SZOMB || (p)->ki_stat == SDEAD) + ((p)->ki_stat == SSTOP || (p)->ki_stat == SZOMB) char * get_argv0(__attribute__ ((unused)) int fd, char *tty) diff --git a/osdep-openbsd.c b/osdep-openbsd.c index 8cbf6f3d..c4a52d23 100644 --- a/osdep-openbsd.c +++ b/osdep-openbsd.c @@ -1,4 +1,4 @@ -/* $Id: osdep-openbsd.c,v 1.8 2009-02-07 19:16:25 nicm Exp $ */ +/* $Id: osdep-openbsd.c,v 1.9 2009-02-07 19:24:50 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -85,16 +85,15 @@ retry: bestp = p; if (!is_stopped(p) && is_stopped(bestp)) bestp = p; - - if (p->p_estcpu < bestp->p_estcpu) - continue; - if (p->p_slptime > bestp->p_slptime) - continue; - if (!(p->p_flag & P_SINTR) && bestp->p_flag & P_SINTR) - continue; - if (LIST_FIRST(&p->p_children) != NULL) - continue; - bestp = p; + if (p->p_estcpu > bestp->p_estcpu) + bestp = p; + if (p->p_slptime < bestp->p_slptime) + bestp = p; + if (p->p_flag & P_SINTR && !(bestp->p_flag & P_SINTR)) + bestp = p; + if (LIST_FIRST(&p->p_children) == NULL && + LIST_FIRST(&bestp->p_children) != NULL) + bestp = p; } if (bestp != NULL) { procname = get_proc_argv0(bestp->p_pid); |