Date: Tue, 8 May 2018 18:25:37 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333381 - head/usr.sbin/efibootmgr Message-ID: <201805081825.w48IPbJE071527@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Tue May 8 18:25:37 2018 New Revision: 333381 URL: https://svnweb.freebsd.org/changeset/base/333381 Log: Inline print_order(). It's used one palce. Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Tue May 8 18:18:27 2018 (r333380) +++ head/usr.sbin/efibootmgr/efibootmgr.c Tue May 8 18:25:37 2018 (r333381) @@ -279,27 +279,6 @@ parse_args(int argc, char *argv[]) static void -print_order(void) -{ - uint32_t attrs; - uint8_t *data; - size_t size, i; - - if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", &data, &size, &attrs) < 0) { - printf("BootOrder : Couldn't get value for BootOrder\n"); - return; - } - - if (size % 2 == 1) - errx(1, "Bad BootOrder variable: odd length"); - - printf("BootOrder : "); - for (i = 0; i < size; i += 2) - printf("%04x%s", le16dec(data + i), i == size - 2 ? "\n" : ", "); -} - - -static void read_vars(void) { @@ -808,7 +787,14 @@ print_boot_vars(bool verbose) if (ret > 0) { printf("Timeout : %d seconds\n", le16dec(data)); } - print_order(); + + if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", &data, &size, &attrs) > 0) { + if (size % 2 == 1) + warn("Bad BootOrder variable: odd length %d", (int)size); + printf("BootOrder : "); + for (size_t i = 0; i < size; i += 2) + printf("%04x%s", le16dec(data + i), i == size - 2 ? "\n" : ", "); + } /* now we want to fetch 'em all fresh again * which possibly includes a newly created bootvar
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805081825.w48IPbJE071527>