From 80b4df3b082f5f51afc0add1f2e59dc5822deef1 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Thu, 20 Apr 2017 23:03:03 -0700 Subject: lib: Add CLI option --moduledir to override default module location (needed for snap support) Signed-off-by: Martin Winter --- lib/module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/module.c') diff --git a/lib/module.c b/lib/module.c index 4ebe3c0da2..c7dd5538cd 100644 --- a/lib/module.c +++ b/lib/module.c @@ -69,7 +69,7 @@ void frrmod_init(struct frrmod_runtime *modinfo) } struct frrmod_runtime *frrmod_load(const char *spec, - char *err, size_t err_len) + const char *dir, char *err, size_t err_len) { void *handle = NULL; char name[PATH_MAX], fullpath[PATH_MAX], *args; @@ -84,12 +84,12 @@ struct frrmod_runtime *frrmod_load(const char *spec, if (!strchr(name, '/')) { if (!handle && execname) { snprintf(fullpath, sizeof(fullpath), "%s/%s_%s.so", - MODULE_PATH, execname, name); + dir, execname, name); handle = dlopen(fullpath, RTLD_NOW | RTLD_GLOBAL); } if (!handle) { snprintf(fullpath, sizeof(fullpath), "%s/%s.so", - MODULE_PATH, name); + dir, name); handle = dlopen(fullpath, RTLD_NOW | RTLD_GLOBAL); } } -- cgit v1.2.3