diff options
| author | Albert Cervin <albert@acervin.com> | 2024-08-14 20:57:07 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-08-14 20:57:07 +0200 |
| commit | 0849b6fa3ff76fb780b7ffd353d63c77c20e63e2 (patch) | |
| tree | 5f1f0201ef84f00e45219e1a50333cb4ad6574ef | |
| parent | e0901a1efb05727111eb88d1b27b7d1a23a87365 (diff) | |
| download | dged-0849b6fa3ff76fb780b7ffd353d63c77c20e63e2.tar.gz dged-0849b6fa3ff76fb780b7ffd353d63c77c20e63e2.tar.xz dged-0849b6fa3ff76fb780b7ffd353d63c77c20e63e2.zip | |
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.
| -rw-r--r-- | src/dged/reactor-epoll.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |
