Skip to content

Commit

Permalink
libscap: use SYSFS_NAME instead of PROBE_DEVICE_NAME to read max_cons…
Browse files Browse the repository at this point in the history
…umers parameter

sysdig-CLA-1.0-signed-off-by: Nicolas Vanheuverzwijn <[email protected]>
  • Loading branch information
nvanheuverzwijn authored and fntlnz committed Nov 27, 2020
1 parent 71e5f67 commit 73569dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions userspace/libscap/scap.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ scap_t* scap_open_udig_int(char *error, int32_t *rc,
static uint32_t get_max_consumers()
{
uint32_t max;
FILE *pfile = fopen("/sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers", "r");
FILE *pfile = fopen("/sys/module/" SYSFS_NAME "/parameters/max_consumers", "r");
if(pfile != NULL)
{
int w = fscanf(pfile, "%"PRIu32, &max);
Expand Down Expand Up @@ -353,7 +353,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
else if(errno == EBUSY)
{
uint32_t curr_max_consumers = get_max_consumers();
snprintf(error, SCAP_LASTERR_SIZE, "Too many sysdig instances attached to device %s. Current value for /sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers is '%"PRIu32"'.", filename, curr_max_consumers);
snprintf(error, SCAP_LASTERR_SIZE, "Too many sysdig instances attached to device %s. Current value for /sys/module/" SYSFS_NAME "/parameters/max_consumers is '%"PRIu32"'.", filename, curr_max_consumers);
}
else
{
Expand Down

0 comments on commit 73569dd

Please sign in to comment.