aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/efibootmgr
diff options
context:
space:
mode:
authorRyan Moeller <freqlabs@FreeBSD.org>2020-10-19 10:38:40 +0000
committerRyan Moeller <freqlabs@FreeBSD.org>2020-10-19 10:38:40 +0000
commitb8adbe1c15af7ed4b150ed70c295639a6299a98a (patch)
tree710b0904595e27a58175cf5679c0ca524cc20a05 /usr.sbin/efibootmgr
parent665c8c3e7dbd0d8f00d6b89e1cc7b2eeb6d1b79d (diff)
downloadsrc-b8adbe1c15af7ed4b150ed70c295639a6299a98a.tar.gz
src-b8adbe1c15af7ed4b150ed70c295639a6299a98a.zip
efibootmgr: Use returned error code for error message, not errno
efivar_unix_path_to_device_path returns the error code, it does not set errno. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26852
Notes
Notes: svn path=/head/; revision=366830
Diffstat (limited to 'usr.sbin/efibootmgr')
-rw-r--r--usr.sbin/efibootmgr/efibootmgr.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c
index 2e2ebed78f90..e12f869bd4b6 100644
--- a/usr.sbin/efibootmgr/efibootmgr.c
+++ b/usr.sbin/efibootmgr/efibootmgr.c
@@ -674,11 +674,16 @@ make_boot_var(const char *label, const char *loader, const char *kernel, const c
err(1, "bootvar creation");
if (loader == NULL)
errx(1, "Must specify boot loader");
- if (efivar_unix_path_to_device_path(loader, &loaderdp) != 0)
- err(1, "Cannot translate unix loader path '%s' to UEFI", loader);
+ ret = efivar_unix_path_to_device_path(loader, &loaderdp);
+ if (ret != 0)
+ errc(1, ret, "Cannot translate unix loader path '%s' to UEFI",
+ loader);
if (kernel != NULL) {
- if (efivar_unix_path_to_device_path(kernel, &kerneldp) != 0)
- err(1, "Cannot translate unix kernel path '%s' to UEFI", kernel);
+ ret = efivar_unix_path_to_device_path(kernel, &kerneldp);
+ if (ret != 0)
+ errc(1, ret,
+ "Cannot translate unix kernel path '%s' to UEFI",
+ kernel);
} else {
kerneldp = NULL;
}