summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/src/luci-bwc.c
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2021-01-09 19:02:30 +0200
committerHannu Nyman <hannu.nyman@iki.fi>2021-01-09 19:02:30 +0200
commitcb454de3e1ebe8213cae448cd50292f3d843bbd7 (patch)
treeb9e8be726145094edd8b00aca473ea14af1fd9cf /modules/luci-mod-status/src/luci-bwc.c
parentc7756834b727137dbdee9abfb8bb7642f311d38f (diff)
luci-mod-status: realtime graph - find suffixed libiwinfo.so
Change the libiwinfo filename handling to match the current version suffixed .so file. Copy solution from bc121a5a4 Fixes #4721 Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'modules/luci-mod-status/src/luci-bwc.c')
-rw-r--r--modules/luci-mod-status/src/luci-bwc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/luci-mod-status/src/luci-bwc.c b/modules/luci-mod-status/src/luci-bwc.c
index 6f7016ec9d..b7682f9e21 100644
--- a/modules/luci-mod-status/src/luci-bwc.c
+++ b/modules/luci-mod-status/src/luci-bwc.c
@@ -253,7 +253,21 @@ static void umap_file(struct file_map *m)
static void * iw_open(void)
{
- return dlopen("/usr/lib/libiwinfo.so", RTLD_LAZY);
+ void *iwlib = NULL;
+ glob_t paths;
+ int i;
+
+ if (glob("/usr/lib/libiwinfo.so*", 0, NULL, &paths) != 0)
+ return NULL;
+
+ for (i = 0; i < paths.gl_pathc && !iwlib; i++)
+ iwlib = dlopen(paths.gl_pathv[i], RTLD_LAZY | RTLD_LOCAL);
+
+ globfree(&paths);
+
+ if (!iwlib)
+ return NULL;
+ return iwlib;
}
static int iw_update(