mirror of https://github.com/xzeldon/htop.git
Apply patch from BenBE as per https://github.com/htop-dev/htop/pull/241#issuecomment-720081138
This commit is contained in:
parent
0951090fa4
commit
8f2d129dce
|
@ -29,7 +29,6 @@ ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, Users
|
||||||
this->cpuCount = 0;
|
this->cpuCount = 0;
|
||||||
|
|
||||||
this->scanTs = 0;
|
this->scanTs = 0;
|
||||||
this->firstScanTs = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBHWLOC
|
#ifdef HAVE_LIBHWLOC
|
||||||
this->topologyOk = false;
|
this->topologyOk = false;
|
||||||
|
@ -91,12 +90,8 @@ void ProcessList_add(ProcessList* this, Process* p) {
|
||||||
assert(Hashtable_get(this->processTable, p->pid) == NULL);
|
assert(Hashtable_get(this->processTable, p->pid) == NULL);
|
||||||
p->processList = this;
|
p->processList = this;
|
||||||
|
|
||||||
if (this->scanTs == this->firstScanTs) {
|
// highlighting processes found in first scan by first scan marked "far in the past"
|
||||||
// prevent highlighting processes found in first scan
|
|
||||||
p->seenTs = this->firstScanTs - this->settings->highlightDelaySecs - 1;
|
|
||||||
} else {
|
|
||||||
p->seenTs = this->scanTs;
|
p->seenTs = this->scanTs;
|
||||||
}
|
|
||||||
|
|
||||||
Vector_add(this->processes, p);
|
Vector_add(this->processes, p);
|
||||||
Hashtable_put(this->processTable, p->pid, p);
|
Hashtable_put(this->processTable, p->pid, p);
|
||||||
|
@ -339,10 +334,11 @@ void ProcessList_scan(ProcessList* this, bool pauseProcessUpdate) {
|
||||||
|
|
||||||
|
|
||||||
// set scanTs
|
// set scanTs
|
||||||
if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) {
|
static bool firstScanDone = false;
|
||||||
if (this->firstScanTs == 0) {
|
if (!firstScanDone) {
|
||||||
this->firstScanTs = now.tv_sec;
|
this->scanTs = 0;
|
||||||
}
|
firstScanDone = true;
|
||||||
|
} else if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) {
|
||||||
this->scanTs = now.tv_sec;
|
this->scanTs = now.tv_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,6 @@ typedef struct ProcessList_ {
|
||||||
int cpuCount;
|
int cpuCount;
|
||||||
|
|
||||||
time_t scanTs;
|
time_t scanTs;
|
||||||
time_t firstScanTs;
|
|
||||||
} ProcessList;
|
} ProcessList;
|
||||||
|
|
||||||
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId);
|
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId);
|
||||||
|
|
Loading…
Reference in New Issue