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
This commit is contained in:
Jilles Tjoelker 2009-05-24 15:32:34 +00:00
parent a6412d5d4b
commit 6dcfa92ee8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192688

View File

@ -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;