diff options
author | jilles <jilles@FreeBSD.org> | 2009-05-24 15:32:34 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2009-05-24 15:32:34 +0000 |
commit | 69cfa0ad1d52bf8ac267e5553311684eb4a8b680 (patch) | |
tree | a629387aa6ff77c18c78b0935661d5649025bb6f /bin | |
parent | 46ec0102e5ca0d1167fcce632f981d012682b966 (diff) | |
download | FreeBSD-src-69cfa0ad1d52bf8ac267e5553311684eb4a8b680.zip FreeBSD-src-69cfa0ad1d52bf8ac267e5553311684eb4a8b680.tar.gz |
Fix elapsed (etime) field for swapped out processes in ps:
show '-' instead of time since the Epoch.
PR: bin/123069
Submitted by: Vladimir Kozbin
Approved by: ed (mentor)
MFC after: 3 weeks
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ps/print.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c index 1bfce04..aa4f98f 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -596,6 +596,10 @@ elapsed(KINFO *k, VARENT *ve) char obuff[128]; v = ve->var; + if (!k->ki_valid) { + (void)printf("%-*s", v->width, "-"); + return; + } val = now - k->ki_p->ki_start.tv_sec; days = val / (24 * 60 * 60); val %= 24 * 60 * 60; |