It's a bug revealed by commit
446e774 "cli: properly unload package
before quit". The current code would exit with value 1 even if
uci_export() succceeded.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
}
if (uci_commit(ctx, &ptr.p, false) != UCI_OK) {
cli_perror();
+ goto out;
}
break;
case CMD_EXPORT:
- uci_export(ctx, stdout, ptr.p, true);
+ if (uci_export(ctx, stdout, ptr.p, true) != UCI_OK) {
+ goto out;
+ }
break;
case CMD_SHOW:
if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) {
break;
}
+ ret = 0;
+
out:
if (ptr.p)
uci_unload(ctx, ptr.p);