Skip to content

Commit 73569dd

Browse files
nvanheuverzwijnfntlnz
authored andcommitted
libscap: use SYSFS_NAME instead of PROBE_DEVICE_NAME to read max_consumers parameter
sysdig-CLA-1.0-signed-off-by: Nicolas Vanheuverzwijn <nicolas.vanheu@gmail.com>
1 parent 71e5f67 commit 73569dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

userspace/libscap/scap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ scap_t* scap_open_udig_int(char *error, int32_t *rc,
114114
static uint32_t get_max_consumers()
115115
{
116116
uint32_t max;
117-
FILE *pfile = fopen("/sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers", "r");
117+
FILE *pfile = fopen("/sys/module/" SYSFS_NAME "/parameters/max_consumers", "r");
118118
if(pfile != NULL)
119119
{
120120
int w = fscanf(pfile, "%"PRIu32, &max);
@@ -353,7 +353,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
353353
else if(errno == EBUSY)
354354
{
355355
uint32_t curr_max_consumers = get_max_consumers();
356-
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);
356+
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);
357357
}
358358
else
359359
{

0 commit comments

Comments
 (0)