summaryrefslogtreecommitdiff
path: root/lib/module.c
diff options
context:
space:
mode:
authorwhitespace / reindent <invalid@invalid.invalid>2017-08-09 11:49:42 +0200
committerwhitespace / reindent <invalid@invalid.invalid>2017-08-09 12:03:17 +0200
commitac4d0be5874fafd14212d6007fff7495edc9b152 (patch)
tree5e2f0d3189de928c849f9983406389ade3b098cb /lib/module.c
parent76a86854181c27819e5cf71b12ae1fa5ccd9e02a (diff)
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/module.c')
-rw-r--r--lib/module.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/module.c b/lib/module.c
index c7dd5538cd..6759a36122 100644
--- a/lib/module.c
+++ b/lib/module.c
@@ -68,8 +68,8 @@ void frrmod_init(struct frrmod_runtime *modinfo)
execname = modinfo->info->name;
}
-struct frrmod_runtime *frrmod_load(const char *spec,
- const char *dir, char *err, size_t err_len)
+struct frrmod_runtime *frrmod_load(const char *spec, const char *dir, char *err,
+ size_t err_len)
{
void *handle = NULL;
char name[PATH_MAX], fullpath[PATH_MAX], *args;
@@ -83,13 +83,13 @@ struct frrmod_runtime *frrmod_load(const char *spec,
if (!strchr(name, '/')) {
if (!handle && execname) {
- snprintf(fullpath, sizeof(fullpath), "%s/%s_%s.so",
- dir, execname, name);
+ snprintf(fullpath, sizeof(fullpath), "%s/%s_%s.so", dir,
+ execname, name);
handle = dlopen(fullpath, RTLD_NOW | RTLD_GLOBAL);
}
if (!handle) {
- snprintf(fullpath, sizeof(fullpath), "%s/%s.so",
- dir, name);
+ snprintf(fullpath, sizeof(fullpath), "%s/%s.so", dir,
+ name);
handle = dlopen(fullpath, RTLD_NOW | RTLD_GLOBAL);
}
}
@@ -100,8 +100,8 @@ struct frrmod_runtime *frrmod_load(const char *spec,
if (!handle) {
if (err)
snprintf(err, err_len,
- "loading module \"%s\" failed: %s",
- name, dlerror());
+ "loading module \"%s\" failed: %s", name,
+ dlerror());
return NULL;
}
@@ -110,8 +110,8 @@ struct frrmod_runtime *frrmod_load(const char *spec,
dlclose(handle);
if (err)
snprintf(err, err_len,
- "\"%s\" is not a Quagga module: %s",
- name, dlerror());
+ "\"%s\" is not a Quagga module: %s", name,
+ dlerror());
return NULL;
}
rtinfo = *rtinfop;
@@ -124,9 +124,8 @@ struct frrmod_runtime *frrmod_load(const char *spec,
if (rtinfo->finished_loading) {
dlclose(handle);
if (err)
- snprintf(err, err_len,
- "module \"%s\" already loaded",
- name);
+ snprintf(err, err_len, "module \"%s\" already loaded",
+ name);
goto out_fail;
}
@@ -134,8 +133,7 @@ struct frrmod_runtime *frrmod_load(const char *spec,
dlclose(handle);
if (err)
snprintf(err, err_len,
- "module \"%s\" initialisation failed",
- name);
+ "module \"%s\" initialisation failed", name);
goto out_fail;
}