summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-05-24 15:32:34 +0000
committerjilles <jilles@FreeBSD.org>2009-05-24 15:32:34 +0000
commit69cfa0ad1d52bf8ac267e5553311684eb4a8b680 (patch)
treea629387aa6ff77c18c78b0935661d5649025bb6f /bin/ps
parent46ec0102e5ca0d1167fcce632f981d012682b966 (diff)
downloadFreeBSD-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/ps')
-rw-r--r--bin/ps/print.c4
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;
OpenPOWER on IntegriCloud