]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: add comments emphasizing that certain functions do not touch the file read... 40447/head
authorLennart Poettering <lennart@amutable.com>
Fri, 6 Feb 2026 21:31:53 +0000 (22:31 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 6 Feb 2026 22:17:02 +0000 (23:17 +0100)
src/bootctl/bootctl-install.c
src/bootctl/bootctl-util.c
src/shared/pe-binary.c

index 2d9a151212dddf71a8c4944824eed05f25484ab4..8399a2da72176d1db6acf1f6f5a18c04f963ee75 100644 (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);
index 23b8786f1d83af362fc31ad2b7988a991a1ab975..071accb77d6a4e2834d399decec95a2976c02b74 100644 (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");
 
index 97e5ba51c7802c0c50f8fe7571c6eeca52ac477e..0a1b93118c291343853e2ce34c0b040435673591 100644 (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);