aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0001-acpid-do-not-install-handlers-for-fatal-signals.patch
blob: b62ab4aade243dd434cc5fe2d9fea64bf87b73ce (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
31
32
33
34
35
36
37
38
39
40
41
42
From bbf1e3c144c1ee93409a0e0546cb56b34eccfcfd Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Sun, 5 Feb 2012 15:08:08 +0100
Subject: [PATCH 1/4] acpid: do not install handlers for fatal signals

For acpid, it's ok to die at once.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 util-linux/acpid.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index 361a2b2..1b22f3a 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -268,8 +268,12 @@ int acpid_main(int argc UNUSED_PARAM, char **argv)
 
 	xchdir(opt_dir);
 
+	/* We spawn children but don't wait for them. Prevent zombies: */
 	bb_signals((1 << SIGCHLD), SIG_IGN);
-	bb_signals(BB_FATAL_SIGS, record_signo);
+	// If you enable this, (1) explain why, (2)
+	// make sure while(poll) loop below is still interruptible
+	// by SIGTERM et al:
+	//bb_signals(BB_FATAL_SIGS, record_signo);
 
 	pfd = NULL;
 	nfd = 0;
@@ -337,7 +341,7 @@ int acpid_main(int argc UNUSED_PARAM, char **argv)
 			}
 			if (!event)
 				continue;
-			// spawn event handler
+			/* spawn event handler */
 			process_event(event);
 		}
 	}
-- 
1.7.9.1