mirror of https://github.com/xzeldon/htop.git
Use PROCDIR throughout instead of /proc on Linux
This commit is contained in:
parent
1efddaf1e5
commit
37921382f4
|
@ -477,7 +477,7 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di
|
||||||
#ifdef HAVE_OPENVZ
|
#ifdef HAVE_OPENVZ
|
||||||
|
|
||||||
static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* dirname, const char* name) {
|
static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* dirname, const char* name) {
|
||||||
if ( (access("/proc/vz", R_OK) != 0)) {
|
if ( (access(PROCDIR "/vz", R_OK) != 0)) {
|
||||||
process->vpid = process->super.pid;
|
process->vpid = process->super.pid;
|
||||||
process->ctid = 0;
|
process->ctid = 0;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -230,8 +230,8 @@ void Platform_setZfsCompressedArcValues(Meter* this) {
|
||||||
ZfsCompressedArcMeter_readStats(this, &(lpl->zfs));
|
ZfsCompressedArcMeter_readStats(this, &(lpl->zfs));
|
||||||
}
|
}
|
||||||
char* Platform_getProcessEnv(pid_t pid) {
|
char* Platform_getProcessEnv(pid_t pid) {
|
||||||
char procname[32+1];
|
char procname[128];
|
||||||
xSnprintf(procname, 32, "/proc/%d/environ", pid);
|
xSnprintf(procname, sizeof(procname), PROCDIR "/%d/environ", pid);
|
||||||
FILE* fd = fopen(procname, "r");
|
FILE* fd = fopen(procname, "r");
|
||||||
char *env = NULL;
|
char *env = NULL;
|
||||||
if (fd) {
|
if (fd) {
|
||||||
|
|
Loading…
Reference in New Issue