MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / install_all_plugins

Function install_all_plugins

db/plugin_handler.c:196–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196static 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. */
226int install_static_plugins(void)

Callers 1

plugin_updateFunction · 0.85

Calls 3

exitFunction · 0.85
install_plugin_intFunction · 0.85
logmsgFunction · 0.50

Tested by

no test coverage detected