mirror of
https://github.com/troglobit/finit.git
synced 2026-10-10 16:52:39 +07:00
Ignore signal instead of setting to an empty handler
As suggested by Metalshark Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ O.4 ()
|
||||
- default username for finit-alt configurable in Makefile
|
||||
- create loopback device node in finit-alt (for squashfs)
|
||||
- add option to use built-in run-parts instead of /bin/run-parts
|
||||
- ignore signal instead of setting to an empty handler (Metalshark)
|
||||
|
||||
0.3 (20080223)
|
||||
- Change poweroff method to reboot(RB_POWER_OFF) (Metalshark)
|
||||
|
||||
+9
-18
@@ -121,15 +121,15 @@ int main()
|
||||
for (i = 1; i < NSIG; i++)
|
||||
SETSIG(sa, i, SIG_IGN, SA_RESTART);
|
||||
|
||||
SETSIG(sa, SIGINT, shutdown, 0);
|
||||
SETSIG(sa, SIGPWR, signal_handler, 0);
|
||||
SETSIG(sa, SIGUSR1, shutdown, 0);
|
||||
SETSIG(sa, SIGUSR2, shutdown, 0);
|
||||
SETSIG(sa, SIGTERM, signal_handler, 0);
|
||||
SETSIG(sa, SIGALRM, signal_handler, 0);
|
||||
SETSIG(sa, SIGHUP, signal_handler, 0);
|
||||
SETSIG(sa, SIGCONT, signal_handler, SA_RESTART);
|
||||
SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART);
|
||||
SETSIG(sa, SIGINT, shutdown, 0);
|
||||
SETSIG(sa, SIGPWR, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGUSR1, shutdown, 0);
|
||||
SETSIG(sa, SIGUSR2, shutdown, 0);
|
||||
SETSIG(sa, SIGTERM, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGALRM, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGHUP, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGCONT, SIG_IGN, SA_RESTART);
|
||||
SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART);
|
||||
|
||||
/* Block sigchild while forking */
|
||||
sigemptyset(&nmask);
|
||||
@@ -379,12 +379,3 @@ void chld_handler(int sig)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We got a signal (PWR TERM ALRM HUP CONT)
|
||||
*/
|
||||
void signal_handler(int sig)
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
|
||||
+10
-19
@@ -41,6 +41,7 @@ Changelog from the original Eeepc fastinit:
|
||||
- Change poweroff method from writing 5 to /sys/power/state to
|
||||
reboot(RB_POWER_OFF) (by Metalshark)
|
||||
- Mount /var/run and /var/lock as tmpfs
|
||||
- Use SIG_IGN instead of empty signal handler (by Metalshark)
|
||||
|
||||
*/
|
||||
|
||||
@@ -83,7 +84,6 @@ Changelog from the original Eeepc fastinit:
|
||||
|
||||
|
||||
void shutdown(int);
|
||||
void signal_handler(int);
|
||||
void chld_handler(int);
|
||||
|
||||
|
||||
@@ -112,15 +112,15 @@ int main()
|
||||
for (i = 1; i < NSIG; i++)
|
||||
SETSIG(sa, i, SIG_IGN, SA_RESTART);
|
||||
|
||||
SETSIG(sa, SIGINT, shutdown, 0);
|
||||
SETSIG(sa, SIGPWR, signal_handler, 0);
|
||||
SETSIG(sa, SIGUSR1, shutdown, 0);
|
||||
SETSIG(sa, SIGUSR2, shutdown, 0);
|
||||
SETSIG(sa, SIGTERM, signal_handler, 0);
|
||||
SETSIG(sa, SIGALRM, signal_handler, 0);
|
||||
SETSIG(sa, SIGHUP, signal_handler, 0);
|
||||
SETSIG(sa, SIGCONT, signal_handler, SA_RESTART);
|
||||
SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART);
|
||||
SETSIG(sa, SIGINT, shutdown, 0);
|
||||
SETSIG(sa, SIGPWR, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGUSR1, shutdown, 0);
|
||||
SETSIG(sa, SIGUSR2, shutdown, 0);
|
||||
SETSIG(sa, SIGTERM, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGALRM, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGHUP, SIG_IGN, 0);
|
||||
SETSIG(sa, SIGCONT, SIG_IGN, SA_RESTART);
|
||||
SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART);
|
||||
|
||||
/* Block sigchild while forking */
|
||||
sigemptyset(&nmask);
|
||||
@@ -318,12 +318,3 @@ void chld_handler(int sig)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We got a signal (PWR TERM ALRM HUP CONT)
|
||||
*/
|
||||
void signal_handler(int sig)
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user