From owner-svn-src-stable-12@freebsd.org Mon Oct 26 12:34:51 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BD65444627; Mon, 26 Oct 2020 12:34:51 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CKZ6M29H8z4CkR; Mon, 26 Oct 2020 12:34:51 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B061A8B1; Mon, 26 Oct 2020 12:34:51 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09QCYpA3036517; Mon, 26 Oct 2020 12:34:51 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09QCYp2f036516; Mon, 26 Oct 2020 12:34:51 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010261234.09QCYp2f036516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 26 Oct 2020 12:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367055 - stable/12/usr.sbin/efibootmgr X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: stable/12/usr.sbin/efibootmgr X-SVN-Commit-Revision: 367055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 12:34:51 -0000 Author: freqlabs Date: Mon Oct 26 12:34:50 2020 New Revision: 367055 URL: https://svnweb.freebsd.org/changeset/base/367055 Log: MFC r366830: 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 Differential Revision: https://reviews.freebsd.org/D26852 Modified: stable/12/usr.sbin/efibootmgr/efibootmgr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- stable/12/usr.sbin/efibootmgr/efibootmgr.c Mon Oct 26 08:17:41 2020 (r367054) +++ stable/12/usr.sbin/efibootmgr/efibootmgr.c Mon Oct 26 12:34:50 2020 (r367055) @@ -641,11 +641,16 @@ make_boot_var(const char *label, const char *loader, 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; }