Skip to content

Commit

Permalink
Use PROCDIR throughout instead of /proc on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones committed Sep 17, 2020
1 parent 1efddaf commit 3792138
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion linux/LinuxProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions linux/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3792138

Please sign in to comment.