Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-07 00:58:15 +0300
committerFelix Fietkau <nbd@openwrt.org>2015-11-07 00:58:15 +0300
commit3d45c47752a36e123895a8b4f7e6b30ac2d0b3a0 (patch)
tree3f95453dda232dc9d1cfa72e84983802d38a1410 /json_script.c
parent136a5196266d03d537f822c4e67d2fde2ed59505 (diff)
json_script: add support for aborting script processing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'json_script.c')
-rw-r--r--json_script.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/json_script.c b/json_script.c
index 73c2502..22d8417 100644
--- a/json_script.c
+++ b/json_script.c
@@ -541,6 +541,9 @@ static int json_process_cmd(struct json_call *call, struct blob_attr *block)
}
blobmsg_for_each_attr(cur, block, rem) {
+ if (ctx->abort)
+ break;
+
switch(blobmsg_type(cur)) {
case BLOBMSG_TYPE_STRING:
if (!i)
@@ -571,6 +574,8 @@ void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *
if (!call.seq)
call.seq = ++_seq;
+ ctx->abort = false;
+
__json_script_run(&call, file, NULL);
}