[PATCH] acpid: fix for clean exit on SIGTERM

Denys Vlasenko vda.linux at googlemail.com
Sun Feb 5 14:07:14 UTC 2012


On Friday 03 February 2012 14:37, Natanael Copa wrote:
> f4b2f335506e570a06d5eab09068da3f61 introduced safe_poll() and no
> longer exits on SIGTERM. We solve this by explicit checking for
> bb_got_signal.

It is not clear why

bb_signals(BB_FATAL_SIGS, record_signo);

was added to acpid.c at all. Why it is not ok to die at once?
I will simply remove it.


> Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
> ---
>  util-linux/acpid.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/util-linux/acpid.c b/util-linux/acpid.c
> index 361a2b2..63c7a6d 100644
> --- a/util-linux/acpid.c
> +++ b/util-linux/acpid.c
> @@ -293,7 +293,7 @@ int acpid_main(int argc UNUSED_PARAM, char **argv)
>  
>  	write_pidfile(opt_pidfile);
>  
> -	while (safe_poll(pfd, nfd, -1) > 0) {
> +	while (safe_poll(pfd, nfd, -1) > 0 && !bb_got_signal) {


This still won't exit on signal, since safe_poll() will just
loop internally when poll() gets EINTR.

-- 
vda


More information about the busybox mailing list