Skip to content
Browse files

linux: fix events after close bug

  • Loading branch information...
1 parent 51e9dbc commit c0e5db2d49d43488ad5169a442eed357c616088d @bnoordhuis bnoordhuis committed Oct 20, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/unix/linux.c
View
4 src/unix/linux.c
@@ -144,6 +144,9 @@ static void uv__inotify_read(EV_P_ ev_io* w, int revents) {
filename = e->len ? e->name : basename_r(handle->filename);
handle->cb(handle, filename, events, 0);
+
+ if (handle->fd == -1)
+ break;
}
}
while (handle->fd != -1); /* handle might've been closed by callback */
@@ -198,4 +201,5 @@ void uv__fs_event_destroy(uv_fs_event_t* handle) {
uv__close(handle->fd);
handle->fd = -1;
free(handle->filename);
+ handle->filename = NULL;
}

0 comments on commit c0e5db2

Please sign in to comment.
Something went wrong with that request. Please try again.