]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-file: const and _pure_'ify journal_file_writable()
authorMike Yuan <me@yhndnzj.com>
Thu, 3 Jul 2025 20:30:12 +0000 (22:30 +0200)
committerMike Yuan <me@yhndnzj.com>
Sat, 5 Jul 2025 09:45:18 +0000 (11:45 +0200)
Follow-up for 1543c2385c0a1afbdc59b50c8ecd132a0d60bbef

src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-file.h

index baabb92fd70af8c8788248bb00e699ffa2d151f8..11e251748a2e6652447a964daf16acef06f640fd 100644 (file)
@@ -4694,8 +4694,9 @@ bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec, int log
         return false;
 }
 
-bool journal_file_writable(JournalFile *f) {
+bool journal_file_writable(const JournalFile *f) {
         assert(f);
+
         return (f->open_flags & O_ACCMODE_STRICT) != O_RDONLY;
 }
 
index 4a5e0d81e2fbcd5941cde2b2b04ec60895e7a47b..68317f1308607c36642e8a8b02de505672751b61 100644 (file)
@@ -378,4 +378,4 @@ static inline uint32_t COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG(Compression c) {
         }
 }
 
-bool journal_file_writable(JournalFile *f);
+bool journal_file_writable(const JournalFile *f) _pure_;