]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
iovec-util: make IOVEC_NULL const
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Oct 2023 14:27:16 +0000 (16:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 20 Oct 2023 08:43:50 +0000 (10:43 +0200)
compound initialized structs can be placed im immutable memory if const,
hence there's benefit in making this one const too

src/basic/iovec-util.h

index 670f57464ac9b1350dbe4acf8717fed4060e937d..d46455371b1cc9991dc0b11ccfc50281ad0d8845 100644 (file)
@@ -32,7 +32,8 @@ static inline bool IOVEC_INCREMENT(struct iovec *i, size_t n, size_t k) {
         return true;
 }
 
-#define IOVEC_NULL (struct iovec) {}
+#define IOVEC_NULL (const struct iovec) {}
+
 #define IOVEC_MAKE(base, len) (struct iovec) { .iov_base = (base), .iov_len = (len) }
 #define IOVEC_MAKE_STRING(string)               \
         ({                                      \