summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32d934c)
raw | patch | inline | side by side (parent: 32d934c)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 27 Apr 2014 14:30:43 +0000 (16:30 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 27 Apr 2014 14:30:43 +0000 (16:30 +0200) |
src/tools/sysdbd/configfile.c | patch | blob | history |
index 8dc4394f7abfce9450b82a6b01c69f6aa32eb74e..992801d2be80d559b5fcf5f41e6046ac1ad6e1e0 100644 (file)
*/
static sdb_time_t default_interval = 0;
+static char *plugin_dir = NULL;
/*
* private helper functions
return config_get_interval(ci, &default_interval);
} /* daemon_set_interval */
+static int
+daemon_set_plugindir(oconfig_item_t *ci)
+{
+ if (oconfig_get_string(ci, &plugin_dir)) {
+ sdb_log(SDB_LOG_ERR, "config: PluginDir requires a single "
+ "string argument\n"
+ "\tUsage: PluginDir DIR");
+ return ERR_INVALID_ARG;
+ }
+ plugin_dir = strdup(plugin_dir);
+ return 0;
+} /* daemon_set_plugindir */
+
static int
daemon_load_plugin(oconfig_item_t *ci)
{
}
/* returns a negative value on error */
- return sdb_plugin_load(NULL, name, NULL);
+ return sdb_plugin_load(plugin_dir, name, NULL);
} /* daemon_load_plugin */
static int
}
}
- return sdb_plugin_load(NULL, plugin_name, &ctx);
+ return sdb_plugin_load(plugin_dir, plugin_name, &ctx);
} /* daemon_load_backend */
static int
static token_parser_t token_parser_list[] = {
{ "Listen", daemon_add_listener },
{ "Interval", daemon_set_interval },
+ { "PluginDir", daemon_set_plugindir },
{ "LoadPlugin", daemon_load_plugin },
{ "LoadBackend", daemon_load_backend },
{ "Backend", daemon_configure_plugin },
oconfig_free(ci);
free(ci);
+
+ if (plugin_dir) {
+ free(plugin_dir);
+ plugin_dir = NULL;
+ }
return retval;
} /* daemon_parse_config */