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:
Lennart Poettering
2025-11-13 14:19:29 +01:00
parent 40cb2aa4f8
commit dbc25d84ae
+3
View File
@@ -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