]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: move flex array in struct inotify_data to the end
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 May 2025 17:45:01 +0000 (02:45 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 4 Jun 2025 04:13:14 +0000 (13:13 +0900)
src/libsystemd/sd-event/event-source.h

index 3be9a0e6c12404b35acc92c450cb2828264fe96b..5fef3b1ac9738551233dace529c26f4e85f6e6bb 100644 (file)
@@ -220,10 +220,6 @@ struct inotify_data {
         Hashmap *inodes; /* The inode_data structures keyed by dev+ino */
         Hashmap *wd;     /* The inode_data structures keyed by the watch descriptor for each */
 
-        /* The buffer we read inotify events into */
-        union inotify_event_buffer buffer;
-        size_t buffer_filled; /* fill level of the buffer */
-
         /* How many event sources are currently marked pending for this inotify. We won't read new events off the
          * inotify fd as long as there are still pending events on the inotify (because we have no strategy of queuing
          * the events locally if they can't be coalesced). */
@@ -237,4 +233,9 @@ struct inotify_data {
         /* A linked list of all inotify objects with data already read, that still need processing. We keep this list
          * to make it efficient to figure out what inotify objects to process data on next. */
         LIST_FIELDS(struct inotify_data, buffered);
+
+        /* The buffer we read inotify events into */
+        size_t buffer_filled; /* fill level of the buffer */
+        union inotify_event_buffer buffer; /* struct inotify_event in union inotify_event_buffer has flex
+                                            * array. Hence, this must be at the end. */
 };