Explorar o código

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 %!s(int64=14) %!d(string=hai) anos
pai
achega
1dcfdfbd03
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  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();