From e8299c8e2386350e55df1ecb41e1f2d086686f81 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 22 Aug 2016 11:42:50 -0400 Subject: [PATCH] libefivar/libs.c:probe(): Fix the case where the first probe fails. When adding efi_set_error() support, I accidentally changed it to treat a probe failure as a success, which winds up meaning you always try efivarfs even if the probe failed. Fixes github issue https://github.com/rhinstaller/efibootmgr/issues/54 Fixes https://bugs.gentoo.org/show_bug.cgi?id=591864 Signed-off-by: Peter Jones --- src/lib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.c b/src/lib.c index 60709e31..03c64b0d 100644 --- a/src/lib.c +++ b/src/lib.c @@ -256,13 +256,13 @@ libefivar_init(void) } } else { int rc = ops_list[i]->probe(); - if (rc <= 0) + if (rc <= 0) { efi_error("ops_list[%d]->probe() failed", i); - else + } else { efi_error_clear(); - - ops = ops_list[i]; - break; + ops = ops_list[i]; + break; + } } } }