]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mmap-cache: use structured initializer
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 28 Sep 2023 00:30:07 +0000 (09:30 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 30 Sep 2023 21:35:02 +0000 (06:35 +0900)
src/libsystemd/sd-journal/mmap-cache.c

index b26183be7697b72eabfef6f5b2181358885417e4..73f5a116205aaab14018e7de1d81a9cf3af6ee3a 100644 (file)
@@ -77,11 +77,14 @@ struct MMapCache {
 MMapCache* mmap_cache_new(void) {
         MMapCache *m;
 
-        m = new0(MMapCache, 1);
+        m = new(MMapCache, 1);
         if (!m)
                 return NULL;
 
-        m->n_ref = 1;
+        *m = (MMapCache) {
+                .n_ref = 1,
+        };
+
         return m;
 }