diff options
Diffstat (limited to 'src/watcher.zig')
-rw-r--r-- | src/watcher.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/watcher.zig b/src/watcher.zig index 33d5aa9a3..35606f697 100644 --- a/src/watcher.zig +++ b/src/watcher.zig @@ -532,10 +532,12 @@ pub fn NewWatcher(comptime ContextType: type) type { comptime copy_file_path: bool, ) !void { if (this.indexOf(hash)) |index| { - // On Linux, the file descriptor might be out of date. - if (fd > 0) { - var fds = this.watchlist.items(.fd); - fds[index] = fd; + if (comptime FeatureFlags.atomic_file_watcher) { + // On Linux, the file descriptor might be out of date. + if (fd > 0) { + var fds = this.watchlist.items(.fd); + fds[index] = fd; + } } return; } |