From 5518652e711a636781414c2a232c4dff1d498904 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Fri, 5 Apr 2024 13:07:21 +0200 Subject: Fix regression from storing monotonic time deltas When starting htop the timestamp of the first scan must be far in the past to avoid showing all processes as being started just recently. Fixes: b61685779cdf696ba4135a97ce66075c337c7562 --- Machine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Machine.c b/Machine.c index 6beb47b4..2c66571e 100644 --- a/Machine.c +++ b/Machine.c @@ -101,11 +101,12 @@ void Machine_scanTables(Machine* this) { if (firstScanDone) { this->prevMonotonicMs = this->monotonicMs; + Platform_gettime_monotonic(&this->monotonicMs); } else { this->prevMonotonicMs = 0; + this->monotonicMs = 1; firstScanDone = true; } - Platform_gettime_monotonic(&this->monotonicMs); assert(this->monotonicMs > this->prevMonotonicMs); this->maxUserId = 0; -- cgit v1.2.3