summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-11-28 12:09:35 +0100
committerJo-Philipp Wich <jo@mein.io>2018-11-28 12:10:40 +0100
commit7235f348958969d8aa0bfffd167acd3cd161efd0 (patch)
tree777919eac81590fad5be61ee68bc0bef73f48700
parentccd7c0af75da808ce284a8fb321ce4571bd250af (diff)
downloadrpcd-7235f348958969d8aa0bfffd167acd3cd161efd0.tar.gz
plugin: store pointer to exec timeout value in the ops structure
This is required for plugins that need access to the configured execution timeout. The global variable cannot be used as-is since we dlopen() with RTLD_LOCAL. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--include/rpcd/plugin.h1
-rw-r--r--plugin.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/rpcd/plugin.h b/include/rpcd/plugin.h
index 8a1178d..363c0d7 100644
--- a/include/rpcd/plugin.h
+++ b/include/rpcd/plugin.h
@@ -54,6 +54,7 @@ struct rpc_daemon_ops {
rpc_exec_read_cb_t err, rpc_exec_done_cb_t end,
void *priv, struct ubus_context *ctx,
struct ubus_request_data *req);
+ int *exec_timeout;
};
struct rpc_plugin {
diff --git a/plugin.c b/plugin.c
index 532fa15..3740622 100644
--- a/plugin.c
+++ b/plugin.c
@@ -404,6 +404,7 @@ static const struct rpc_daemon_ops ops = {
.session_create_cb = rpc_session_create_cb,
.session_destroy_cb = rpc_session_destroy_cb,
.exec = rpc_exec,
+ .exec_timeout = &rpc_exec_timeout,
};
static int