Rationalize plugin symbol error reporting
Change-Id: I64f2b2007f30fc1c6bd2990ba0d7ccbcd43cdb38 Signed-off-by: Dave Barach <dave@barachs.net>
This commit is contained in:

committed by
Florin Coras

parent
6e4d4a3684
commit
3464c86065
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user