aboutsummaryrefslogtreecommitdiff
path: root/lib/libefivar/efivar.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libefivar/efivar.c')
-rw-r--r--lib/libefivar/efivar.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libefivar/efivar.c b/lib/libefivar/efivar.c
index 4d485287a6d1..68f6beacc885 100644
--- a/lib/libefivar/efivar.c
+++ b/lib/libefivar/efivar.c
@@ -132,10 +132,7 @@ rv_to_linux_rv(int rv)
{
if (rv == 0)
rv = 1;
- else if (errno == ENOENT) {
- rv = 0;
- errno = 0;
- } else
+ else
rv = -errno;
return (rv);
}
@@ -266,6 +263,11 @@ errout:
/* XXX The linux interface expects name to be a static buffer -- fix or leak memory? */
done:
+ if (errno == ENOENT) {
+ errno = 0;
+ return 0;
+ }
+
return (rv_to_linux_rv(rv));
}