From 9b38c01b540b60408f8eb1d9c288656405e25f7e Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Tue, 11 Mar 2014 01:44:44 +0400 Subject: [PATCH] kqueue: invalidate fd in uv_fs_event_t Invalidate file descriptor when closing `uv_fs_event_t` handle. Note that `uv__io_stop` is just removing `fd` from `loop->watchers` and not actually invalidating all consequent events in a `kevent()` results. fix joyent/node#1101 --- src/unix/kqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unix/kqueue.c b/src/unix/kqueue.c index dc642034..124f4fd5 100644 --- a/src/unix/kqueue.c +++ b/src/unix/kqueue.c @@ -359,10 +359,10 @@ fallback: void uv__fs_event_close(uv_fs_event_t* handle) { #if defined(__APPLE__) if (uv__fsevents_close(handle)) - uv__io_stop(handle->loop, &handle->event_watcher, UV__POLLIN); -#else - uv__io_stop(handle->loop, &handle->event_watcher, UV__POLLIN); #endif /* defined(__APPLE__) */ + { + uv__io_close(handle->loop, &handle->event_watcher); + } uv__handle_stop(handle);