diff options
author | Nathan Scott <nathans@redhat.com> | 2021-08-13 15:56:01 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-08-13 15:56:01 +1000 |
commit | f839095e3b29668d080c89f3b32fb6dccff54030 (patch) | |
tree | 7ef2d9359dea6e171c882f5b6ec5620eb4555396 /pcp/PCPProcessList.c | |
parent | 6974ce8e7982d061f26dbbe7c5ca48d7aa6f4dbc (diff) | |
parent | 6f2021f3d95e02fc54e59fdeeb006e34c209b9c3 (diff) |
Merge branch 'dynamic-columns' of https://github.com/smalinux/htop into smalinux-dynamic-columns
Diffstat (limited to 'pcp/PCPProcessList.c')
-rw-r--r-- | pcp/PCPProcessList.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pcp/PCPProcessList.c b/pcp/PCPProcessList.c index 638ece21..8e644b07 100644 --- a/pcp/PCPProcessList.c +++ b/pcp/PCPProcessList.c @@ -2,7 +2,7 @@ htop - PCPProcessList.c (C) 2014 Hisham H. Muhammad (C) 2020-2021 htop dev team -(C) 2020-2021 Red Hat, Inc. All Rights Reserved. +(C) 2020-2021 Red Hat, Inc. Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ @@ -11,11 +11,15 @@ in the source distribution for its full text. #include "pcp/PCPProcessList.h" +#include <limits.h> #include <math.h> +#include <stdlib.h> +#include <string.h> +#include <sys/time.h> -#include "CRT.h" #include "Macros.h" #include "Object.h" +#include "Platform.h" #include "Process.h" #include "Settings.h" #include "XUtils.h" @@ -57,11 +61,11 @@ static char* setUser(UsersTable* this, unsigned int uid, int pid, int offset) { return name; } -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* pidMatchList, uid_t userId) { +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { PCPProcessList* this = xCalloc(1, sizeof(PCPProcessList)); ProcessList* super = &(this->super); - ProcessList_init(super, Class(PCPProcess), usersTable, dynamicMeters, pidMatchList, userId); + ProcessList_init(super, Class(PCPProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); struct timeval timestamp; gettimeofday(×tamp, NULL); @@ -334,6 +338,7 @@ static bool PCPProcessList_updateProcesses(PCPProcessList* this, double period, PCPProcess* pp = (PCPProcess*) proc; PCPProcessList_updateID(proc, pid, offset); proc->isUserlandThread = proc->pid != proc->tgid; + pp->offset = offset >= 0 ? offset : 0; /* * These conditions will not trigger on first occurrence, cause we need to |