efivars: seek back to beginning in each efi_get_variable() loop
We try to read again from the beginning, hence let's seek back. Apparently efivarfs doesn't strictly require this, but it's really weird that it doesn't.
This commit is contained in:
@@ -114,6 +114,9 @@ int efi_get_variable(
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBUSY), "Reading EFI variable '%s' failed even after %u tries, giving up.", p, try);
|
||||
if (try >= EFI_N_RETRIES_NO_DELAY)
|
||||
(void) usleep_safe(EFI_RETRY_DELAY);
|
||||
|
||||
/* Start from the beginning */
|
||||
(void) lseek(fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
/* Unfortunately kernel reports EOF if there's an inconsistency between efivarfs var list and
|
||||
|
||||
Reference in New Issue
Block a user