loop: make uloop_run() return the cancelling signal
authorMatthias Schiffer <mschiffer@universe-factory.net>
Tue, 21 Jun 2016 15:19:11 +0000 (17:19 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sun, 26 Jun 2016 10:55:31 +0000 (12:55 +0200)
commit1ad3d93eb888ae7db3dd97e43e611979352b1aac
tree999111caeec71c4e5af728b384d02a91b8d76b3d
parent1f019ceea1ed39286e6bccfb3ff936c22fe0f7c0
loop: make uloop_run() return the cancelling signal

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].

[1] https://www.cons.org/cracauer/sigint.html

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
uloop.c
uloop.h