diff options
| author | Martin Winter <mwinter@opensourcerouting.org> | 2017-04-20 23:03:03 -0700 |
|---|---|---|
| committer | Martin Winter <mwinter@opensourcerouting.org> | 2017-04-21 02:37:11 -0700 |
| commit | 80b4df3b082f5f51afc0add1f2e59dc5822deef1 (patch) | |
| tree | ef082629ddac23c0ce5af2debcd5c24bb6070099 /lib/module.c | |
| parent | ae4989487412cc455bfed48a6ceab63423ba5f08 (diff) | |
lib: Add CLI option --moduledir to override default module location (needed for snap support)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Diffstat (limited to 'lib/module.c')
| -rw-r--r-- | lib/module.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } } |
