chiark / gitweb /
util: fix strict aliasing violations in use of struct inotify_event v5
[elogind.git] / src / udev / udevd.c
index 8bec03e77f0e0874e2396a3f02bb15d178dd2f1b..c3678259bcbc1a2050e0e296af6ecd6191793358 100644 (file)
@@ -816,11 +816,11 @@ static int synthesize_change(struct udev_device *dev) {
 }
 
 static int handle_inotify(struct udev *udev) {
-        uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct inotify_event);
+        union inotify_event_buffer buffer;
         struct inotify_event *e;
         ssize_t l;
 
-        l = read(fd_inotify, buffer, sizeof(buffer));
+        l = read(fd_inotify, &buffer, sizeof(buffer));
         if (l < 0) {
                 if (errno == EAGAIN || errno == EINTR)
                         return 0;