aboutsummaryrefslogtreecommitdiff
path: root/lib/libsysdecode/flags.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-06-10 01:20:08 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2017-06-10 01:20:08 +0000
commit30b94d0cf4a0e4e013403c676c321598fb16edc6 (patch)
tree8b3f7b72d977b757f6bb0a842048af90e73aeaf3 /lib/libsysdecode/flags.c
parentdd0c462cf501fd543bcd96ad097fe6f12500ab3b (diff)
Notes
Diffstat (limited to 'lib/libsysdecode/flags.c')
-rw-r--r--lib/libsysdecode/flags.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c
index bf0319f5dcaf..eb28820a0365 100644
--- a/lib/libsysdecode/flags.c
+++ b/lib/libsysdecode/flags.c
@@ -634,8 +634,19 @@ sysdecode_quotactl_cmd(FILE *fp, int cmd)
bool
sysdecode_reboot_howto(FILE *fp, int howto, int *rem)
{
+ bool printed;
- return (print_mask_int(fp, rebootopt, howto, rem));
+ /*
+ * RB_AUTOBOOT is special in that its value is zero, but it is
+ * also an implied argument if a different operation is not
+ * requested via RB_HALT, RB_POWEROFF, or RB_REROOT.
+ */
+ if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT)) == 0) {
+ fputs("RB_AUTOBOOT|", fp);
+ printed = true;
+ } else
+ printed = false;
+ return (print_mask_int(fp, rebootopt, howto, rem) || printed);
}
bool