From 73569dd70a056afb7db477e41e7bdc4be5837d88 Mon Sep 17 00:00:00 2001 From: Nicolas Vanheuverzwijn Date: Wed, 5 Aug 2020 11:59:50 -0400 Subject: [PATCH] libscap: use SYSFS_NAME instead of PROBE_DEVICE_NAME to read max_consumers parameter sysdig-CLA-1.0-signed-off-by: Nicolas Vanheuverzwijn --- userspace/libscap/scap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userspace/libscap/scap.c b/userspace/libscap/scap.c index 477384ce56..c064173c73 100644 --- a/userspace/libscap/scap.c +++ b/userspace/libscap/scap.c @@ -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); @@ -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 {