diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-04-17 21:12:08 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-04-17 21:12:08 +0000 |
commit | fb737690984505c86ccb7eca08ad27653bbbea34 (patch) | |
tree | b2d3e4ddf86d5f2c802ea4d6f5a0b69d0b4d1965 /bin/ps | |
parent | 1f3df21a77e720429383b26adc01a502c559c16c (diff) |
Missing bits from last commit here; kstailey@disclosure.com
Diffstat (limited to 'bin/ps')
-rw-r--r-- | bin/ps/ps.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 1bd7c800b9a..ba0161c4bb1 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ps.c,v 1.18 2001/04/17 00:50:16 millert Exp $ */ +/* $OpenBSD: ps.c,v 1.19 2001/04/17 21:12:07 millert Exp $ */ /* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: ps.c,v 1.18 2001/04/17 00:50:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: ps.c,v 1.19 2001/04/17 21:12:07 millert Exp $"; #endif #endif /* not lint */ @@ -85,7 +85,7 @@ int totwidth; /* calculated width of requested variables */ int needcomm, needenv, commandonly; -enum sort { DEFAULT, SORTMEM, SORTCPU, SORTSTART } sortby = SORTSTART; +enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; static char *kludge_oldps_options __P((char *)); static int pscomp __P((const void *, const void *)); @@ -422,15 +422,11 @@ pscomp(a, b) return (getpcpu((KINFO *)b) - getpcpu((KINFO *)a)); if (sortby == SORTMEM) return (VSIZE((KINFO *)b) - VSIZE((KINFO *)a)); - if (sortby == SORTSTART) { + i = KI_EPROC((KINFO *)a)->e_tdev - KI_EPROC((KINFO *)b)->e_tdev; + if (i == 0) i = STARTTIME(((KINFO *)a)) - STARTTIME(((KINFO *)b)); if (i == 0) i = STARTuTIME(((KINFO *)a)) - STARTuTIME(((KINFO *)b)); - return (i); - } - i = KI_EPROC((KINFO *)a)->e_tdev - KI_EPROC((KINFO *)b)->e_tdev; - if (i == 0) - i = KI_PROC((KINFO *)a)->p_pid - KI_PROC((KINFO *)b)->p_pid; return (i); } |