On 2014-03-19 13:50, Alexander Couzens wrote: > uci_file_commit() tries to open and lock a package file (e.g. > /etc/config/system) > before writing into. When the package file doesn't exist, uci fails with > 'Entry not found'. > --- > file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/file.c b/file.c > index 36bfdda..04973f3 100644 > --- a/file.c > +++ b/file.c > @@ -714,7 +714,7 @@ static void uci_file_commit(struct uci_context *ctx, > struct uci_package **packag > UCI_THROW(ctx, UCI_ERR_IO); > > /* open the config file for writing now, so that it is locked */ > - f1 = uci_open_stream(ctx, p->path, SEEK_SET, false, false); > + f1 = uci_open_stream(ctx, p->path, SEEK_SET, true, true); I think that's wrong. The code should be changed to skip the first open (which is only used for merging saved uci delta into the current runtime state) if the config file does not yet exist.
- Felix _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
