bootctl: add comments emphasizing that certain functions do not touch the file read pointer

This commit is contained in:
Lennart Poettering
2026-02-06 23:17:02 +01:00
parent 1dad3b6762
commit a537c5e4b8
3 changed files with 6 additions and 0 deletions
+2
View File
@@ -490,6 +490,8 @@ static int version_check(int fd_from, const char *from, int fd_to, const char *t
assert(fd_to >= 0);
assert(to);
/* Does not reposition file offset */
r = get_file_version(fd_from, &a);
if (r == -ESRCH)
return log_notice_errno(r, "Source file \"%s\" does not carry version information!", from);
+2
View File
@@ -75,6 +75,8 @@ int get_file_version(int fd, char **ret) {
assert(fd >= 0);
assert(ret);
/* Does not reposition file offset (as it uses mmap()) */
if (fstat(fd, &st) < 0)
return log_error_errno(errno, "Failed to stat EFI binary: %m");
+2
View File
@@ -12,6 +12,8 @@
#include "string-table.h"
#include "string-util.h"
/* Note: none of these function change the file position of the provided fd, as they use pread() */
bool pe_header_is_64bit(const PeHeader *h) {
assert(h);