summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-09-15 12:29:46 +0200
committercgzones <cgzones@googlemail.com>2020-09-17 21:44:27 +0200
commit37921382f49c34738207146d84d1258e2fe0b88d (patch)
treec2ab0f9d886465d9f2aa2af45d21af50be9d9131
parent1efddaf1e5a8da0406f336c85491f2fd720d6860 (diff)
Use PROCDIR throughout instead of /proc on Linux
-rw-r--r--linux/LinuxProcessList.c2
-rw-r--r--linux/Platform.c4
2 files changed, 3 insertions, 3 deletions
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) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy