mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
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:
parent
a6412d5d4b
commit
6dcfa92ee8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192688
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user