From 4f629ff865b978a7ea399776ff6af83c6428bda0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 12 Feb 2008 12:11:15 +0100 Subject: [PATCH] use the per-package backend on commit --- libuci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libuci.c b/libuci.c index da2d15e..6bbc874 100644 --- a/libuci.c +++ b/libuci.c @@ -172,11 +172,13 @@ int uci_list_configs(struct uci_context *ctx, char ***list) int uci_commit(struct uci_context *ctx, struct uci_package **package, bool overwrite) { + struct uci_package *p; UCI_HANDLE_ERR(ctx); UCI_ASSERT(ctx, package != NULL); - UCI_ASSERT(ctx, *package != NULL); - UCI_ASSERT(ctx, ctx->backend && ctx->backend->commit); - ctx->backend->commit(ctx, package, overwrite); + p = *package; + UCI_ASSERT(ctx, p != NULL); + UCI_ASSERT(ctx, p->backend && p->backend->commit); + p->backend->commit(ctx, package, overwrite); return 0; } -- 2.41.1