X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=file.c;h=23ea9595974826c8a8cf85fb37909794c12d4a00;hp=7188a90a59b902f135a0cffdc00530c07a430f7a;hb=27cef8e19174dacd5744c6944a76ebc5afa27130;hpb=0a18953fa3ff8aabea37d81b434e9f577e3fbf34 diff --git a/file.c b/file.c index 7188a90..23ea959 100644 --- a/file.c +++ b/file.c @@ -907,8 +907,14 @@ int uci_commit(struct uci_context *ctx, struct uci_package **package, bool overw if (!overwrite) { name = uci_strdup(ctx, p->e.name); path = uci_strdup(ctx, p->path); + /* dump our own changes to the history file */ if (!uci_list_empty(&p->history)) UCI_INTERNAL(uci_save, ctx, p); + + /* + * other processes might have modified the config + * as well. dump and reload + */ uci_free_package(&p); uci_file_cleanup(ctx); UCI_INTERNAL(uci_import, ctx, f, name, &p, true);