https://github.com/slicer69/sysvinit/pull/18 https://bugs.gentoo.org/911257 From fca101c2ff428eb765958ae6e3aaa0eb1adc0fdf Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 27 Jul 2023 00:39:53 -0300 Subject: [PATCH] Floppym provided patch which causes the halt command to call "shutdown -h -H" instead of "shutdown -h" when halt is invoked without parameters. This forces the shutdown command to set the INIT_HALT variable and assume, unless other conditions apply, that the "halt" call really wants to halt the machine and INIT_HALT should be set. In other words we assume halt wants to halt unless told otherwise. Addresses downstream Gentoo bug ID 911257. --- doc/Changelog | 11 +++++++++++ src/halt.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index c00f6ef..b902756 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,14 @@ +sysvinit (3.08) unreleased; urgency=low + * Floppym provided patch which causes the halt command + to call "shutdown -h -H" instead of "shutdown -h" when + halt is invoked without parameters. This forces the shutdown + command to set the INIT_HALT variable and assume, unless other + conditions apply, that the "halt" call really wants to halt the + machine and INIT_HALT should be set. In other words we + assume halt wants to halt unless told otherwise. + Addresses downstream Gentoo bug ID 911257. + + sysvinit (3.07) released; urgency=low * Fixed killall5 so that processes in the omit list are not sent any signals, including SIGSTOP. diff --git a/src/halt.c b/src/halt.c index a469147..9bd3a4d 100644 --- a/src/halt.c +++ b/src/halt.c @@ -162,8 +162,8 @@ void do_shutdown(char *fl, int should_poweroff, char *tm) args[i++] = "shutdown"; args[i++] = fl; - if ( (! strcmp(fl, "-h") ) && (should_poweroff) ) - args[i++] = "-P"; + if (! strcmp(fl, "-h")) + args[i++] = (should_poweroff ? "-P" : "-H"); if (tm) { args[i++] = "-t"; args[i++] = tm;