diff options
author | Felix Fietkau <nbd@nbd.name> | 2024-05-01 18:40:19 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2024-05-02 10:31:40 +0200 |
commit | f211d5ac666fbde1fb2bbf3de7065344f5108bad (patch) | |
tree | 7c72983ba74c97bee00b3073358bd4943915e45e /lib/ubus.c | |
parent | 69dd962870097dcda43af9bee0494ea75bcc0e31 (diff) |
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>
Diffstat (limited to 'lib/ubus.c')
-rw-r--r-- | lib/ubus.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -665,6 +665,11 @@ uc_ubus_have_uloop(void) bool prev = uloop_cancelled; bool active; +#ifdef HAVE_ULOOP_FD_SET_CB + if (uloop_fd_set_cb) + return true; +#endif + uloop_cancelled = true; active = uloop_cancelling(); uloop_cancelled = prev; |