mirror of https://github.com/xzeldon/htop.git
parent
64ecba2583
commit
f4f6d54ffd
|
@ -106,10 +106,6 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
|
||||||
this->cpus[i].totalPeriod = 1;
|
this->cpus[i].totalPeriod = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_OPENVZ
|
|
||||||
this->flags |= PROCESS_FLAG_LINUX_OPENVZ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return pl;
|
return pl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,11 +324,10 @@ static bool LinuxProcessList_readStatmFile(LinuxProcess* process, const char* di
|
||||||
|
|
||||||
#ifdef HAVE_OPENVZ
|
#ifdef HAVE_OPENVZ
|
||||||
|
|
||||||
static void LinuxProcessList_readOpenVZData(ProcessList* this, Process* process, const char* dirname, const char* name) {
|
static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* dirname, const char* name) {
|
||||||
if ( (!(this->flags & PROCESS_FLAG_LINUX_OPENVZ)) || (access("/proc/vz", R_OK) != 0)) {
|
if ( (access("/proc/vz", R_OK) != 0)) {
|
||||||
process->vpid = process->pid;
|
process->vpid = process->super.pid;
|
||||||
process->ctid = 0;
|
process->ctid = 0;
|
||||||
this->flags |= ~PROCESS_FLAG_LINUX_OPENVZ;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char filename[MAX_NAME+1];
|
char filename[MAX_NAME+1];
|
||||||
|
@ -350,6 +345,7 @@ static void LinuxProcessList_readOpenVZData(ProcessList* this, Process* process,
|
||||||
"%*32u %*32u %32u %32u",
|
"%*32u %*32u %32u %32u",
|
||||||
&process->vpid, &process->ctid);
|
&process->vpid, &process->ctid);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -551,22 +547,27 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
|
||||||
proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid);
|
proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid);
|
||||||
|
|
||||||
#ifdef HAVE_OPENVZ
|
#ifdef HAVE_OPENVZ
|
||||||
LinuxProcessList_readOpenVZData(this, lp, dirname, name);
|
if (settings->flags & PROCESS_FLAG_LINUX_OPENVZ) {
|
||||||
|
LinuxProcessList_readOpenVZData(lp, dirname, name);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_VSERVER
|
#ifdef HAVE_VSERVER
|
||||||
if (settings->flags & PROCESS_FLAG_LINUX_VSERVER)
|
if (settings->flags & PROCESS_FLAG_LINUX_VSERVER) {
|
||||||
LinuxProcessList_readVServerData(lp, dirname, name);
|
LinuxProcessList_readVServerData(lp, dirname, name);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (! LinuxProcessList_readCmdlineFile(proc, dirname, name))
|
if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) {
|
||||||
goto errorReadingProcess;
|
goto errorReadingProcess;
|
||||||
|
}
|
||||||
|
|
||||||
ProcessList_add(pl, proc);
|
ProcessList_add(pl, proc);
|
||||||
} else {
|
} else {
|
||||||
if (settings->updateProcessNames) {
|
if (settings->updateProcessNames) {
|
||||||
if (! LinuxProcessList_readCmdlineFile(proc, dirname, name))
|
if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) {
|
||||||
goto errorReadingProcess;
|
goto errorReadingProcess;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue