bootctl: add comments emphasizing that certain functions do not touch the file read pointer
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user