Skip to content

Commit

Permalink
Merge pull request #428 from aanderse/path/sysctl
Browse files Browse the repository at this point in the history
  • Loading branch information
troglobit authored Feb 21, 2025
2 parents cf201a4 + 0d742d6 commit ecf65ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/procps.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include "helpers.h"
#include "plugin.h"

#ifndef SYSCTL_PATH
#define SYSCTL_PATH "/sbin/sysctl"
#endif

static void setup(void *arg)
{
glob_t gl;
Expand All @@ -54,7 +58,7 @@ static void setup(void *arg)
for (i = 0; i < gl.gl_pathc; i++) {
char cmd[160];

snprintf(cmd, sizeof(cmd), "/sbin/sysctl -e -p %s >/dev/null", gl.gl_pathv[i]);
snprintf(cmd, sizeof(cmd), "%s -e -p %s >/dev/null", SYSCTL_PATH, gl.gl_pathv[i]);
run(cmd, "sysctl");
}
globfree(&gl);
Expand Down

0 comments on commit ecf65ce

Please sign in to comment.