summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 8cdb79cd8f..402203e0dd 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -31,6 +31,7 @@
#include <stddef.h>
#include <unistd.h>
#include <sys/socket.h>
+#include <sys/inotify.h>
#include "time-util.h"
#include "missing.h"
@@ -463,6 +464,11 @@ int execute_command(const char *command, char *const argv[]);
#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
#define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
- for ((e) = (struct inotify_event*) (buffer); \
- (uint8_t*) (e) < (uint8_t*) (buffer) + (sz); \
+ for ((e) = &buffer.ev; \
+ (uint8_t*) (e) < (uint8_t*) (buffer.raw) + (sz); \
(e) = (struct inotify_event*) ((uint8_t*) (e) + sizeof(struct inotify_event) + (e)->len))
+
+union inotify_event_buffer {
+ struct inotify_event ev;
+ uint8_t raw[INOTIFY_EVENT_MAX];
+};