fix: fix the fixes and add more error logging

This commit is contained in:
CJ van den Berg 2026-03-15 00:17:52 +01:00
parent eb42d23fc8
commit f60f9e6a21
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 30 additions and 8 deletions

View file

@ -210,7 +210,8 @@ fn thread_fn(
}
// Re-arm ReadDirectoryChangesW for the next batch.
w.overlapped = std.mem.zeroes(windows.OVERLAPPED);
_ = win32.ReadDirectoryChangesW(w.handle, w.buf.ptr, buf_size, 1, notify_filter, null, &w.overlapped, null);
if (win32.ReadDirectoryChangesW(w.handle, w.buf.ptr, buf_size, 1, notify_filter, null, &w.overlapped, null) == 0)
std.log.err("nightwatch: ReadDirectoryChangesW re-arm failed for {s}, future events lost", .{entry.key_ptr.*});
break;
}
watches_mutex.unlock();