Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2025 23:27:13 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7f39d05b67ae - main - reboot: Fix halt -p behavior
Message-ID:  <6945df51.22b37.32a1af3d@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f39d05b67aec8b87fbad8d5b6381084f99120ec

commit 7f39d05b67aec8b87fbad8d5b6381084f99120ec
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-12-19 23:26:23 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-12-19 23:26:37 +0000

    reboot: Fix halt -p behavior
    
    The RB_HALT bit is always set when invoked as `halt`, so to maintain a
    distinction between `halt` and `halt -p`, we must check the RB_POWEROFF
    bit first.
    
    PR:             291814
    Fixes:          4453ec5b8716 ("reboot: Default to a clean shutdown")
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D54320
---
 sbin/reboot/reboot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c
index a147b7e08a95..002a393000eb 100644
--- a/sbin/reboot/reboot.c
+++ b/sbin/reboot/reboot.c
@@ -235,9 +235,9 @@ shutdown(int howto)
 {
 	char sigstr[SIG2STR_MAX];
 	int signo =
-	    howto & RB_HALT ? SIGUSR1 :
-	    howto & RB_POWEROFF ? SIGUSR2 :
 	    howto & RB_POWERCYCLE ? SIGWINCH :
+	    howto & RB_POWEROFF ? SIGUSR2 :
+	    howto & RB_HALT ? SIGUSR1 :
 	    howto & RB_REROOT ? SIGEMT :
 	    SIGINT;
 


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6945df51.22b37.32a1af3d>