assert(ret == 0);
}
-int md_config_t::set_val(const char *key, const char *val, bool meta)
+int md_config_t::set_val(const char *key, const char *val, bool meta, bool safe)
{
Mutex::Locker l(lock);
if (!key)
for (int i = 0; i < NUM_CONFIG_OPTIONS; ++i) {
config_option *opt = &config_optionsp[i];
if (strcmp(opt->name, k.c_str()) == 0) {
- if (internal_safe_to_start_threads) {
+ if (safe && internal_safe_to_start_threads) {
// If threads have been started...
if ((opt->type == OPT_STR) || (opt->type == OPT_ADDR) ||
(opt->type == OPT_UUID)) {
// Set a configuration value.
// Metavariables will be expanded.
- int set_val(const char *key, const char *val, bool meta=true);
+ int set_val(const char *key, const char *val, bool meta=true, bool safe=true);
+ int set_val(const char *key, const string& s, bool meta=true, bool safe=true) {
+ return set_val(key, s.c_str(), meta, safe);
+ }
// Get a configuration value.
// No metavariables will be returned (they will have already been expanded)