[PATCH] ubus: add a private field to event handlers

Louis_Hampton at SERCOMM.COM Louis_Hampton at SERCOMM.COM
Tue Jul 13 04:57:49 PDT 2021


This is particularly useful in multithreaded non-C FFI, where
additional context from where the event handler was registered may be
critical to ensuring the output of the event is sent to the right
location.

Signed-off-by: Louis Hampton <louis_hampton at sercomm.com>
---
 libubus.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libubus.h b/libubus.h
index 6925514..e6af291 100644
--- a/libubus.h
+++ b/libubus.h
@@ -149,6 +149,7 @@ struct ubus_event_handler {
 	struct ubus_object obj;
 
 	ubus_event_handler_t cb;
+	void *priv;
 };
 
 struct ubus_context {
-- 
2.32.0



More information about the openwrt-devel mailing list