libubus: restore uloop_cancelled on timeout
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 15 Sep 2014 12:42:09 +0000 (15:42 +0300)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 15 Sep 2014 13:48:54 +0000 (15:48 +0200)
Context: 1 loop with a single ubus_invoke() that times out calls
uloop_end() which ends the loop, and thus ends the application.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
libubus-req.c

index ebc580684eb0f1e20fa197f96f5538010ca5e3c2..d44db51f315922362e62f02931cc88f4e08af3cb 100644 (file)
@@ -153,6 +153,7 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
                        timeout = time_end - get_time_msec();
                        if (timeout <= 0) {
                                ubus_set_req_status(req, UBUS_STATUS_TIMEOUT);
+                               uloop_cancelled = cancelled;
                                break;
                        }
                }