浏览代码

cfg framework: add/del_group_inst updates the local config

add/del_group_inst() updates the local configuration to
make sure that cfg_set_*() sees the change when it immediately
follows the group intance modification.
Miklos Tirpak 14 年之前
父节点
当前提交
1dcfdfbd03
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      cfg/cfg_ctx.c

+ 10 - 0
cfg/cfg_ctx.c

@@ -1494,6 +1494,11 @@ int cfg_add_group_inst(cfg_ctx_t *ctx, str *group_name, unsigned int group_id)
 		group_name->len, group_name->s,
 		group_id);
 
+	/* Make sure that cfg_set_*() sees the change when
+	 * the function is immediately called after the group
+	 * instance has been added. */
+	cfg_update();
+
 	return 0;
 error:
 	CFG_WRITER_UNLOCK();
@@ -1583,6 +1588,11 @@ int cfg_del_group_inst(cfg_ctx_t *ctx, str *group_name, unsigned int group_id)
 		group_name->len, group_name->s,
 		group_id);
 
+	/* Make sure that cfg_set_*() sees the change when
+	 * the function is immediately called after the group
+	 * instance has been deleted. */
+	cfg_update();
+
 	return 0;
 error:
 	CFG_WRITER_UNLOCK();