| 194 | } |
| 195 | |
| 196 | static int install_all_plugins(const char *file_name) |
| 197 | { |
| 198 | void *handle; |
| 199 | comdb2_plugin_t *plugin; |
| 200 | |
| 201 | handle = dlopen(file_name, RTLD_LAZY); |
| 202 | if (!handle) { |
| 203 | logmsg(LOGMSG_FATAL, "dlopen() failed: %s\n", dlerror()); |
| 204 | exit(1); |
| 205 | } |
| 206 | |
| 207 | plugin = (comdb2_plugin_t *)dlsym(handle, "comdb2_plugin"); |
| 208 | if (!plugin) { |
| 209 | logmsg(LOGMSG_FATAL, "dlsym() failed: %s\n", dlerror()); |
| 210 | exit(1); |
| 211 | } |
| 212 | |
| 213 | while (plugin->name) { |
| 214 | if (install_plugin_int(plugin)) { |
| 215 | logmsg(LOGMSG_ERROR, "Failed to install plugin %s.\n", |
| 216 | plugin->name); |
| 217 | return 1; |
| 218 | } |
| 219 | ++plugin; |
| 220 | } |
| 221 | |
| 222 | return 0; |
| 223 | } |
| 224 | |
| 225 | /* Install all static plugins. */ |
| 226 | int install_static_plugins(void) |
no test coverage detected