blob: a1659be3c89fd196e8b003df572ea5238e79eab0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 1 May 2024 18:40:19 +0200
Subject: [PATCH] ubus: fix uc_ubus_have_uloop for eloop+uloop combination
When uloop has been integrated with eloop (in hostapd/wpa_supplicant),
uloop_cancelling will return false, since uloop_run is not being called.
This leads to ubus.defer() calling uloop_run in a context where it can
prevent the other event loop from running.
Fix this by detecting event loop integration via uloop_fd_set_cb being set
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/lib/ubus.c
+++ b/lib/ubus.c
@@ -665,6 +665,9 @@ uc_ubus_have_uloop(void)
bool prev = uloop_cancelled;
bool active;
+ if (uloop_fd_set_cb)
+ return true;
+
uloop_cancelled = true;
active = uloop_cancelling();
uloop_cancelled = prev;
|