From: Damjan Marion Date: Tue, 25 Apr 2017 19:07:52 +0000 (+0200) Subject: Exit if plugin load attempt fail X-Git-Tag: v17.07-rc1~277 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=c9fc77c510e042cf9379b427b63dd3f17a23a584;p=vpp.git 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 --- 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;