From 0849b6fa3ff76fb780b7ffd353d63c77c20e63e2 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 14 Aug 2024 20:57:07 +0200 Subject: Use IN_CLOSE_WRITE for inotify on Linux This is safer since the event is only emitted once the file is closed, not every time it is modified and it seems to yield more reliable results. --- src/dged/reactor-epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dged/reactor-epoll.c b/src/dged/reactor-epoll.c index 22888f6..ead0296 100644 --- a/src/dged/reactor-epoll.c +++ b/src/dged/reactor-epoll.c @@ -82,7 +82,7 @@ bool reactor_poll_event(struct reactor *reactor, uint32_t ev_id) { uint32_t reactor_watch_file(struct reactor *reactor, const char *path, uint32_t mask) { // TODO: change if we get more event types - mask = IN_MODIFY; + mask = IN_CLOSE_WRITE; int fd = inotify_add_watch(reactor->inotify_fd, path, mask); if (fd == -1) { -- cgit v1.2.3