summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorINAGAKI Hiroshi2025-12-13 10:31:03 +0000
committerAlexander Couzens2026-02-13 10:11:48 +0000
commit9493a3dcb48b9b3e197e9edfc37304fcd1b5acae (patch)
treeb07f9a358178cd3526a6ec78563ac0f22a4611f8
parent4dd22d022f9fa05fda1871505a003cb40378ff3e (diff)
signal: handle SIGUSR1 as halt
The SIGUSR1 (10) signal sent from BusyBox halt is for halt, so set the RB_HALT_SYSTEM to event instead of RB_POWER_OFF for system call. Link: https://github.com/openwrt/procd/pull/25/commits Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
-rw-r--r--signal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index 9974153..7cbbe1a 100644
--- a/signal.c
+++ b/signal.c
@@ -43,6 +43,9 @@ static void signal_shutdown(int signal, siginfo_t *siginfo, void *data)
msg = "reboot";
break;
case SIGUSR1:
+ event = RB_HALT_SYSTEM;
+ msg = "halt";
+ break;
case SIGUSR2:
case SIGPWR:
event = RB_POWER_OFF;