aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-02-11 23:06:30 +0000
committerWarner Losh <imp@FreeBSD.org>2021-02-11 23:09:51 +0000
commit7fe2f504f8a0e4237872f8528e911c5f7b7ed59d (patch)
tree7214032db82d3e2afa8a8436db2a97a66373bc80
parent145bf6c0af48b89f13465e145f4516de37c31d85 (diff)
downloadsrc-7fe2f504f8a0e4237872f8528e911c5f7b7ed59d.tar.gz
src-7fe2f504f8a0e4237872f8528e911c5f7b7ed59d.zip
efibootmgr: Check for efi supported after parsing args
Move the check for efi variables being supported to after parsing the args. This allows '-h' to produce both as a normal user as well as on all systems.
-rw-r--r--usr.sbin/efibootmgr/efibootmgr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c
index 8c7ba82cb5a5..53bc417c4e07 100644
--- a/usr.sbin/efibootmgr/efibootmgr.c
+++ b/usr.sbin/efibootmgr/efibootmgr.c
@@ -1072,11 +1072,12 @@ int
main(int argc, char *argv[])
{
+ memset(&opts, 0, sizeof (bmgr_opts_t));
+ parse_args(argc, argv);
+
if (!efi_variables_supported())
errx(1, "efi variables not supported on this system. root? kldload efirt?");
- memset(&opts, 0, sizeof (bmgr_opts_t));
- parse_args(argc, argv);
read_vars();
if (opts.create)