chiark / gitweb /
util: fix strict aliasing violations in use of struct inotify_event v5
[elogind.git] / src / journal / sd-journal.c
index d46dc3c29c6a7cee21eb44e5af5a7918e18e812c..2ce9262a203ec4b0710731bf23a6529ac53f1b5e 100644 (file)
@@ -2188,11 +2188,11 @@ _public_ int sd_journal_process(sd_journal *j) {
         j->last_process_usec = now(CLOCK_MONOTONIC);
 
         for (;;) {
-                uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event);
+                union inotify_event_buffer buffer;
                 struct inotify_event *e;
                 ssize_t l;
 
-                l = read(j->inotify_fd, buffer, sizeof(buffer));
+                l = read(j->inotify_fd, &buffer, sizeof(buffer));
                 if (l < 0) {
                         if (errno == EAGAIN || errno == EINTR)
                                 return got_something ? determine_change(j) : SD_JOURNAL_NOP;