Commit 3aa81d0d authored by Jo-Philipp Wich's avatar Jo-Philipp Wich

file: access exec timeout via daemon ops structure

Since the plugin is not linked, but dlopen()'d with RTLD_LOCAL, we cannot
access global rpcd variables but need to access them via the common ops
structure symbol.
Signed-off-by: default avatarJo-Philipp Wich <>
parent 7235f348
......@@ -53,6 +53,8 @@ = rpc_file_##name##_state_cb; \
ustream_fd_init(&us, fd);
static const struct rpc_daemon_ops *ops;
struct rpc_file_exec_context {
struct ubus_context *context;
struct ubus_request_data request;
......@@ -690,7 +692,7 @@ rpc_file_exec_run(const char *cmd,
c->timeout.cb = rpc_file_exec_timeout_cb;
uloop_timeout_set(&c->timeout, rpc_exec_timeout);
uloop_timeout_set(&c->timeout, *ops->exec_timeout);
......@@ -742,6 +744,8 @@ rpc_file_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
.n_methods = ARRAY_SIZE(file_methods),
ops = o;
return ubus_add_object(ctx, &obj);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment