[LEDE-DEV] [PATCH libubox 2/3] loop: make uloop_run() return the cancelling signal

Matthias Schiffer mschiffer at universe-factory.net
Mon Jun 20 02:11:39 PDT 2016


On 06/20/2016 09:59 AM, Matthias Schiffer wrote:
> When a process quits in response to a signal it handles, it should to so
> be re-sending the signal to itself. This especially important for SIGINT,
> as is explained in [1].
> 
> uloop currently hides the reason for quitting uloop_run(). Fix this by
> returning the signal that caused the loop to quit (or 0 when uloop_end()
> was used), so a program using loop an comply with [1].
> 
> uloop_cancelled is renamed to uloop_status, so accidentially running a
> process compiled with one uloop_cancelled definition against the other is
> not possible.

I've just noticed that this will also require a ubus change, as libubus is
accessing uloop_cancelled directly.

Would you prefer to keep uloop_cancelled with its old definition and add
ubus_status as an additional variable to keep this compatible? An
alternative would be to provide a helper uloop_is_cancelled() based on
ubus_status and adjust libubus accordingly.

Regards,
Matthias

> 
> [1] https://www.cons.org/cracauer/sigint.html
> 
> Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20160620/318f5e26/attachment.sig>


More information about the Lede-dev mailing list