From 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 2 May 2023 09:02:22 +1000 Subject: Introduce Machine class for host-specific info (split from ProcessList) First stage in sanitizing the process list structure so that htop can support other types of lists too (cgroups, filesystems, ...), in the not-too-distant future. This introduces struct Machine for system-wide information while keeping process-list information in ProcessList (now much less). Next step is to propogate this separation into each platform, to match these core changes. --- ClockMeter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ClockMeter.c') diff --git a/ClockMeter.c b/ClockMeter.c index 8e3b66e6..ee712ae2 100644 --- a/ClockMeter.c +++ b/ClockMeter.c @@ -22,10 +22,10 @@ static const int ClockMeter_attributes[] = { }; static void ClockMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; + const Machine* host = this->host; struct tm result; - const struct tm* lt = localtime_r(&pl->realtime.tv_sec, &result); + const struct tm* lt = localtime_r(&host->realtime.tv_sec, &result); this->values[0] = lt->tm_hour * 60 + lt->tm_min; strftime(this->txtBuffer, sizeof(this->txtBuffer), "%H:%M:%S", lt); } -- cgit v1.2.3