=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/procname.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/tmux/procname.c 2009/06/26 10:55:37 1.2 --- src/usr.bin/tmux/procname.c 2009/07/26 19:42:26 1.3 *************** *** 1,4 **** ! /* $OpenBSD: procname.c,v 1.2 2009/06/26 10:55:37 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: procname.c,v 1.3 2009/07/26 19:42:26 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 82,122 **** continue; } ! if (is_runnable(p) && !is_runnable(bestp)) bestp = p; - else if (!is_runnable(p) && is_runnable(bestp)) continue; ! if (!is_stopped(p) && is_stopped(bestp)) bestp = p; - else if (is_stopped(p) && !is_stopped(bestp)) continue; ! if (p->p_estcpu > bestp->p_estcpu) bestp = p; - else if (p->p_estcpu < bestp->p_estcpu) continue; ! if (p->p_slptime < bestp->p_slptime) bestp = p; - else if (p->p_slptime > bestp->p_slptime) continue; ! if (p->p_flag & P_SINTR && !(bestp->p_flag & P_SINTR)) bestp = p; - else if (!(p->p_flag & P_SINTR) && bestp->p_flag & P_SINTR) continue; if (LIST_FIRST(&p->p_children) == NULL && ! LIST_FIRST(&bestp->p_children) != NULL) /* XXX ugh */ bestp = p; ! else if (LIST_FIRST(&p->p_children) != NULL && LIST_FIRST(&bestp->p_children) == NULL) continue; ! if (strcmp(p->p_comm, p->p_comm) < 0) bestp = p; ! else if (strcmp(p->p_comm, p->p_comm) > 0) continue; if (p->p_pid > bestp->p_pid) --- 82,129 ---- continue; } ! if (is_runnable(p) && !is_runnable(bestp)) { bestp = p; continue; + } else if (!is_runnable(p) && is_runnable(bestp)) + continue; ! if (!is_stopped(p) && is_stopped(bestp)) { bestp = p; continue; + } else if (is_stopped(p) && !is_stopped(bestp)) + continue; ! if (p->p_estcpu > bestp->p_estcpu) { bestp = p; continue; + } else if (p->p_estcpu < bestp->p_estcpu) + continue; ! if (p->p_slptime < bestp->p_slptime) { bestp = p; continue; + } else if (p->p_slptime > bestp->p_slptime) + continue; ! if (p->p_flag & P_SINTR && !(bestp->p_flag & P_SINTR)) { bestp = p; continue; + } else if (!(p->p_flag & P_SINTR) && bestp->p_flag & P_SINTR) + continue; if (LIST_FIRST(&p->p_children) == NULL && ! LIST_FIRST(&bestp->p_children) != NULL) { /* XXX ugh */ bestp = p; ! continue; ! } else if (LIST_FIRST(&p->p_children) != NULL && LIST_FIRST(&bestp->p_children) == NULL) continue; ! if (strcmp(p->p_comm, bestp->p_comm) < 0) { bestp = p; ! continue; ! } else if (strcmp(p->p_comm, bestp->p_comm) > 0) continue; if (p->p_pid > bestp->p_pid)