aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0001-acpid-fix-for-clean-exit-on-SIGTERM.patch
blob: 421897188905f69633d02a4b08aa05b3ee2df1be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 4d5e59384109ab83309f07b67a1e2eef1f392daf Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 3 Feb 2012 14:32:51 +0100
Subject: [PATCH] acpid: fix for clean exit on SIGTERM

f4b2f335506e570a06d5eab09068da3f61 introduced safe_poll() and no
longer exits on SIGTERM. We solve this by explicit checking for
bb_got_signal.

Signed-off-by: Natanael Copa <ncopa@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) {
 		int i;
 		for (i = 0; i < nfd; i++) {
 			const char *event;
-- 
1.7.9