From 55ff82c0db20fe79c7be2a2e6c5e1ce99f33ffa6 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 15 Oct 2016 06:16:35 +0000 Subject: [PATCH] Implement -t. Use symbolic names in place of the magical 0x7. Submitted by: ambrisko@ --- usr.sbin/efivar/efivar.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efivar/efivar.c b/usr.sbin/efivar/efivar.c index 39ab733fe0a4..a4dac498d680 100644 --- a/usr.sbin/efivar/efivar.c +++ b/usr.sbin/efivar/efivar.c @@ -62,7 +62,7 @@ static struct option longopts[] = { static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag, lflag, Lflag, Rflag, wflag, pflag; static char *varname; -static u_long attrib = 0x7; +static u_long attrib = EFI_VARIABLE_NON_VOLATILE |EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; static void usage(void) @@ -294,11 +294,13 @@ parse_args(int argc, char **argv) case 'R': Rflag++; break; + case 't': + attrib = strtoul(optarg, NULL, 16); + break; case 'w': wflag++; break; case 'f': - case 't': case 0: errx(1, "unknown or unimplemented option\n"); break;