diff options
Diffstat (limited to 'harness/src/plugin.c')
| -rw-r--r-- | harness/src/plugin.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/harness/src/plugin.c b/harness/src/plugin.c index d71608a..6344f4a 100644 --- a/harness/src/plugin.c +++ b/harness/src/plugin.c @@ -37,7 +37,7 @@ static void shx(uint8_t *state, uint32_t sz) { } } -int read_plugin_from_file(const char *filename, plugin_t *plugin) { +int load_plugin_from_file(const char *filename, plugin_t *plugin) { dlhandle_t lib = dlopen(filename, RTLD_LAZY); if (!lib) { @@ -49,7 +49,7 @@ int read_plugin_from_file(const char *filename, plugin_t *plugin) { return load_plugin_from_dl(lib, plugin); } -int plugin_hot_reload(int argc, char **argv, dlhandle_t library, +int plugin_hot_reload(int argc, char **argv, const char* filepath, plugin_t *plugin) { int ec = 0; uint32_t sz = 0; @@ -67,12 +67,10 @@ int plugin_hot_reload(int argc, char **argv, dlhandle_t library, printf("State Marshalled:\n"); shx(marshalled_state, sz); - if (library != plugin->library_handle) { - printf("Unloading old library handle.\n"); - dlclose(plugin->library_handle); - } + printf("Unloading old library handle.\n"); + dlclose(plugin->library_handle); - if ((ec = load_plugin_from_dl(library, plugin))) { + if ((ec = load_plugin_from_file(filepath, plugin))) { goto fail; } |