Skip to content

Commit

Permalink
Fix regression from storing monotonic time deltas
Browse files Browse the repository at this point in the history
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: b616857
  • Loading branch information
BenBE authored and cgzones committed Apr 5, 2024
1 parent 62c2d82 commit 5518652
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5518652

Please sign in to comment.