mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Don't convert ENOENT to nothing for individual lookup, just for the
iterative get_next interface. This prevents efivar(3) from printing 4k of 0's when a variable isn't set. Sponsored by: Netflix
This commit is contained in:
parent
d8fab838af
commit
589c673b32
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314231
|
@ -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 @@ efi_get_next_variable_name(efi_guid_t **guid, char **name)
|
|||
|
||||
/* 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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue