diff options
author | Dave Barach <dave@barachs.net> | 2018-03-12 17:38:31 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-03-13 01:35:23 +0000 |
commit | 3464c860650c5d8cc8abf11c7d2faa074105b8d6 (patch) | |
tree | 7ff8767f2e4b213c604ed396036dc0178fc190c0 | |
parent | 6e4d4a3684914d071a9b9249217bb6222aeb1d24 (diff) |
Rationalize plugin symbol error reporting
Change-Id: I64f2b2007f30fc1c6bd2990ba0d7ccbcd43cdb38
Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r-- | src/vat/plugin.c | 9 | ||||
-rw-r--r-- | src/vlib/unix/plugin.c | 2 | ||||
-rw-r--r-- | src/vpp/api/plugin.c | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/vat/plugin.c b/src/vat/plugin.c index 20de8c50b6f..b94c4fc30d0 100644 --- a/src/vat/plugin.c +++ b/src/vat/plugin.c @@ -40,14 +40,19 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi) if (handle == 0) { clib_warning ("%s", dlerror ()); - return -1; + return 0; } pi->handle = handle; register_handle = dlsym (pi->handle, "vat_plugin_register"); if (register_handle == 0) - return 0; + { + clib_warning ("%s: symbol vat_plugin_register not found", pi->name); + dlclose (handle); + return 0; + } + fp = register_handle; diff --git a/src/vlib/unix/plugin.c b/src/vlib/unix/plugin.c index 058afcfcae0..a1df3b24b66 100644 --- a/src/vlib/unix/plugin.c +++ b/src/vlib/unix/plugin.c @@ -141,7 +141,7 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init) { clib_warning ("%s", dlerror ()); clib_warning ("Failed to load plugin '%s'", pi->name); - os_exit (1); + goto error; } pi->handle = handle; diff --git a/src/vpp/api/plugin.c b/src/vpp/api/plugin.c index e8b134173d8..95bdbe6cd7e 100644 --- a/src/vpp/api/plugin.c +++ b/src/vpp/api/plugin.c @@ -40,14 +40,18 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi) if (handle == 0) { clib_warning ("%s", dlerror ()); - return -1; + return 0; } pi->handle = handle; register_handle = dlsym (pi->handle, "vat_plugin_register"); if (register_handle == 0) - return 0; + { + clib_warning ("%s: symbol vat_plugin_register not found", pi->name); + dlclose (handle); + return 0; + } fp = register_handle; |