diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 2f17974a..cf91900b 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -477,7 +477,7 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di #ifdef HAVE_OPENVZ 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->ctid = 0; return; diff --git a/linux/Platform.c b/linux/Platform.c index e82d8f88..0545fc46 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -230,8 +230,8 @@ void Platform_setZfsCompressedArcValues(Meter* this) { ZfsCompressedArcMeter_readStats(this, &(lpl->zfs)); } char* Platform_getProcessEnv(pid_t pid) { - char procname[32+1]; - xSnprintf(procname, 32, "/proc/%d/environ", pid); + char procname[128]; + xSnprintf(procname, sizeof(procname), PROCDIR "/%d/environ", pid); FILE* fd = fopen(procname, "r"); char *env = NULL; if (fd) {