acpid: do not install handlers for fatal signals
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 5 Feb 2012 14:08:08 +0000 (15:08 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 5 Feb 2012 14:08:08 +0000 (15:08 +0100)
For acpid, it's ok to die at once.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/acpid.c

index 361a2b206285cf18bc74424a6397da5d2a41ca94..1b22f3a01c8af7ad0bf3ff01b89f348e62c7172c 100644 (file)
@@ -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);
                }
        }