From b93e5c00b6cad873942a2709f990a0626d98e7be Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 11 Mar 2009 13:05:19 +0000 Subject: [PATCH] Rename VEID to CTID in OpenVZ systems (thanks to Thorsten Schifferdecker) --- ChangeLog | 2 ++ Process.c | 14 +++++++------- Process.h | 4 ++-- ProcessList.c | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0933932..82dd7e8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ What's new in version 0.8.2 * Option to display hostname in the meters area +* Rename VEID to CTID in OpenVZ systems + (thanks to Thorsten Schifferdecker) * Corrections to the desktop entry file (thanks by Samuli Suominen) * BUGFIX: Fix missing tree view when userland threads are hidden diff --git a/Process.c b/Process.c index 89a80c33..ee954de1 100644 --- a/Process.c +++ b/Process.c @@ -47,7 +47,7 @@ typedef enum ProcessField_ { PROCESSOR, M_SIZE, M_RESIDENT, M_SHARE, M_TRS, M_DRS, M_LRS, M_DT, ST_UID, PERCENT_CPU, PERCENT_MEM, USER, TIME, NLWP, TGID, #ifdef HAVE_OPENVZ - VEID, VPID, + CTID, VPID, #endif #ifdef HAVE_VSERVER VXID, @@ -124,7 +124,7 @@ typedef struct Process_ { float percent_mem; char* user; #ifdef HAVE_OPENVZ - unsigned int veid; + unsigned int ctid; unsigned int vpid; #endif #ifdef HAVE_VSERVER @@ -163,7 +163,7 @@ char *Process_fieldNames[] = { "M_TRS", "M_DRS", "M_LRS", "M_DT", "ST_UID", "PERCENT_CPU", "PERCENT_MEM", "USER", "TIME", "NLWP", "TGID", #ifdef HAVE_OPENVZ - "VEID", "VPID", + "CTID", "VPID", #endif #ifdef HAVE_VSERVER "VXID", @@ -185,7 +185,7 @@ char *Process_fieldTitles[] = { " CODE ", " DATA ", " LIB ", " DIRTY ", " UID ", "CPU% ", "MEM% ", "USER ", " TIME+ ", "NLWP ", " TGID ", #ifdef HAVE_OPENVZ - " VEID ", " VPID ", + " CTID ", " VPID ", #endif #ifdef HAVE_VSERVER " VXID ", @@ -397,7 +397,7 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel break; } #ifdef HAVE_OPENVZ - case VEID: snprintf(buffer, n, "%5u ", this->veid); break; + case CTID: snprintf(buffer, n, "%5u ", this->ctid); break; case VPID: snprintf(buffer, n, "%5u ", this->vpid); break; #endif #ifdef HAVE_VSERVER @@ -566,8 +566,8 @@ int Process_compare(const void* v1, const void* v2) { case NLWP: return (p1->nlwp - p2->nlwp); #ifdef HAVE_OPENVZ - case VEID: - return (p1->veid - p2->veid); + case CTID: + return (p1->ctid - p2->ctid); case VPID: return (p1->vpid - p2->vpid); #endif diff --git a/Process.h b/Process.h index 3cac7311..54dbf87f 100644 --- a/Process.h +++ b/Process.h @@ -49,7 +49,7 @@ typedef enum ProcessField_ { PROCESSOR, M_SIZE, M_RESIDENT, M_SHARE, M_TRS, M_DRS, M_LRS, M_DT, ST_UID, PERCENT_CPU, PERCENT_MEM, USER, TIME, NLWP, TGID, #ifdef HAVE_OPENVZ - VEID, VPID, + CTID, VPID, #endif #ifdef HAVE_VSERVER VXID, @@ -126,7 +126,7 @@ typedef struct Process_ { float percent_mem; char* user; #ifdef HAVE_OPENVZ - unsigned int veid; + unsigned int ctid; unsigned int vpid; #endif #ifdef HAVE_VSERVER diff --git a/ProcessList.c b/ProcessList.c index 0ac015fd..4ffd80da 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -621,7 +621,7 @@ static bool ProcessList_processEntries(ProcessList* this, char* dirname, Process #ifdef HAVE_OPENVZ if (access("/proc/vz", R_OK) != 0) { process->vpid = process->pid; - process->veid = 0; + process->ctid = 0; } else { snprintf(statusfilename, MAX_NAME, "%s/%s/stat", dirname, name); status = ProcessList_fopen(this, statusfilename, "r"); @@ -635,7 +635,7 @@ static bool ProcessList_processEntries(ProcessList* this, char* dirname, Process "%*u %*u %*u %*u %*u %*u %*u %*u " "%*u %*u %*u %*u %*u %*u %*u " "%*u %*u %u %u", - &process->vpid, &process->veid); + &process->vpid, &process->ctid); fclose(status); } #endif