From cd0fc3a4fdf6aa41710ba653f8587d932d809c7e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 27 Feb 2007 22:02:51 +0100 Subject: [PATCH] src/configfile.c: Actually set the `BaseDir' option. --- src/configfile.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 6aafc569..a8f902fd 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -60,7 +60,6 @@ typedef struct cf_global_option_s /* * Prototypes of callback functions */ -static int dispatch_value_pidfile (const oconfig_item_t *ci); static int dispatch_value_plugindir (const oconfig_item_t *ci); static int dispatch_value_loadplugin (const oconfig_item_t *ci); @@ -71,7 +70,6 @@ static cf_callback_t *first_callback = NULL; static cf_value_map_t cf_value_map[] = { - {"PIDFile", dispatch_value_pidfile}, {"PluginDir", dispatch_value_plugindir}, {"LoadPlugin", dispatch_value_loadplugin} }; @@ -151,18 +149,16 @@ static int cf_dispatch (const char *type, const char *orig_key, DBG ("return (%i)", ret); return (ret); -} +} /* int cf_dispatch */ -static int dispatch_value_pidfile (const oconfig_item_t *ci) +static int dispatch_global_option (const oconfig_item_t *ci) { - assert (strcasecmp (ci->key, "PIDFile") == 0); - if (ci->values_num != 1) return (-1); if (ci->values[0].type != OCONFIG_TYPE_STRING) return (-1); - return (global_option_set ("PIDFile", ci->values[0].value.string)); + return (global_option_set (ci->key, ci->values[0].value.string)); } static int dispatch_value_plugindir (const oconfig_item_t *ci) @@ -238,6 +234,13 @@ static int dispatch_value (const oconfig_item_t *ci) break; } + for (i = 0; i < cf_global_options_num; i++) + if (strcasecmp (cf_global_options[i].key, ci->key) == 0) + { + ret = dispatch_global_option (ci); + break; + } + return (ret); } /* int dispatch_value */ -- 2.30.2