2
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
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();