From: Yehuda Sadeh Date: Tue, 3 Mar 2009 18:14:17 +0000 (-0800) Subject: conf: the return of --lockdep, other fixes X-Git-Tag: v0.7~64 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad13632d5bebe33a0d28322c99da60f29f391e6f;p=ceph.git conf: the return of --lockdep, other fixes --- diff --git a/src/config.cc b/src/config.cc index 3d27dd96367..ffaa6129ea5 100644 --- a/src/config.cc +++ b/src/config.cc @@ -741,13 +741,18 @@ void parse_startup_config_options(std::vector& args) #define NEXT_VAL (val_pos ? &args[i][val_pos] : args[++i]) #define SET_ARG_VAL(dest, type) \ set_conf_val(dest, type, NEXT_VAL) +#define SAFE_SET_ARG_VAL(dest, type) \ + do { \ + if (isarg || val_pos || config_optionsp[optn].type == BOOL) \ + SET_ARG_VAL(dest, type); \ + } while (0) #define SET_BOOL_ARG_VAL(dest) \ - set_conf_val(dest, BOOL, (val_pos ? &args[i][val_pos] : "false")) + set_conf_val(dest, BOOL, (val_pos ? &args[i][val_pos] : "true")) #define CMD_EQ(str_cmd, char_cmd) \ cmd_equals(args[i], str_cmd, char_cmd, &val_pos) if (CMD_EQ("conf_file", 'c')) { - SET_ARG_VAL(&g_conf.conf_file, STR); + SAFE_SET_ARG_VAL(&g_conf.conf_file, STR); } else if (CMD_EQ("dump_conf", 0)) { SET_BOOL_ARG_VAL(&g_conf.dump_conf); } else if (CMD_EQ("bind", 0)) { @@ -783,7 +788,9 @@ void parse_config_options(std::vector& args) int optn; for (optn = 0; optn < opt_len; optn++) { - if (cmd_equals(args[i], + if (CMD_EQ("conf_file", 'c')) { + SAFE_SET_ARG_VAL(&g_conf.conf_file, STR); + else if (cmd_equals(args[i], config_optionsp[optn].name, config_optionsp[optn].char_option, &val_pos)) {