mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Rename VEID to CTID in OpenVZ systems
(thanks to Thorsten Schifferdecker)
This commit is contained in:
parent
10213f3ea1
commit
b93e5c00b6
@ -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
|
||||
|
14
Process.c
14
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user