diff options
author | 2017-08-25 13:09:13 +0200 | |
---|---|---|
committer | 2017-08-25 13:09:13 +0200 | |
commit | b74a7373e768736dc12057e0ef9744dcc8a93443 (patch) | |
tree | be827b6f6dfe9411aaff2768044f850812bd9df0 /src/afb-config.c | |
parent | 4e925980d16a7468a55ad2c23cc29ec51311ef6d (diff) |
Add option --weak-ldpaths (for weak loading path)
This option allows to specify a loading path where
binding that fails on load are ignored.
Change-Id: Ie0646f88ba9207dd117737a8b251a7a42f424f02
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-config.c')
-rw-r--r-- | src/afb-config.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/afb-config.c b/src/afb-config.c index 98dd4e55..18f7fa7a 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -68,7 +68,7 @@ #define SET_LDPATH 13 #define SET_APITIMEOUT 14 #define SET_CNTXTIMEOUT 15 - +#define SET_WEAK_LDPATH 16 #define SET_MODE 18 @@ -136,6 +136,7 @@ static AFB_options cliOptions[] = { {SET_LDPATH, 1, "ldpaths", "Load bindings from dir1:dir2:... [default = " BINDING_INSTALL_DIR "]"}, {SO_BINDING, 1, "binding", "Load the binding of path"}, + {SET_WEAK_LDPATH, 1, "weak-ldpaths","Same as --ldpaths but ignore erros"}, {SET_AUTH_TOKEN, 1, "token", "Initial Secret [default=no-session, --token= for session without authentication]"}, {SET_RNDTOKEN, 0, "random-token","Creates a random token"}, @@ -458,6 +459,10 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) list_add(&config->ldpaths, argvalstr(optc)); break; + case SET_WEAK_LDPATH: + list_add(&config->weak_ldpaths, argvalstr(optc)); + break; + case ADD_CALL: list_add(&config->calls, argvalstr(optc)); break; @@ -607,7 +612,7 @@ static void config_set_default(struct afb_config *config) if (config->rootapi == NULL) config->rootapi = "/api"; - if (config->ldpaths == NULL) + if (config->ldpaths == NULL && config->weak_ldpaths == NULL) list_add(&config->ldpaths, BINDING_INSTALL_DIR); // if no config dir create a default path from uploaddir |