diff options
author | Damjan Marion <damarion@cisco.com> | 2017-04-25 21:07:52 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-04-26 00:11:35 +0000 |
commit | c9fc77c510e042cf9379b427b63dd3f17a23a584 (patch) | |
tree | 28abfb3795fe8846bbf378efb2ba8f600cf8c881 /src/vlib | |
parent | 82b13a89a3cd436b9d3ed5538952508354ea65ba (diff) |
Exit if plugin load attempt fail
This happens mainly if plugin contains unresolved symbol.
Such situation typically leads on crash a bit later so it is better
to exit immediatelly and display meaningful error message.
Change-Id: I4abd9a9089a4863400bf609e8d3fd7cebab92913
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/unix/plugin.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/vlib/unix/plugin.c b/src/vlib/unix/plugin.c index 9b341cc8113..c2741aaa074 100644 --- a/src/vlib/unix/plugin.c +++ b/src/vlib/unix/plugin.c @@ -137,15 +137,11 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init) handle = dlopen ((char *) pi->filename, RTLD_LAZY); - /* - * Note: this can happen if the plugin has an undefined symbol reference, - * so print a warning. Otherwise, the poor slob won't know what happened. - * Ask me how I know that... - */ if (handle == 0) { clib_warning ("%s", dlerror ()); - return -1; + clib_warning ("Failed to load plugin '%s'", pi->name); + os_exit (1); } pi->handle = handle; |