diff --git a/src/unix/kqueue.c b/src/unix/kqueue.c index 77064175..b4f9f5d8 100644 --- a/src/unix/kqueue.c +++ b/src/unix/kqueue.c @@ -377,7 +377,7 @@ fallback: int uv_fs_event_stop(uv_fs_event_t* handle) { if (!uv__is_active(handle)) - return -EINVAL; + return 0; uv__handle_stop(handle); diff --git a/src/unix/linux-inotify.c b/src/unix/linux-inotify.c index 20bc1735..2ecc5ebf 100644 --- a/src/unix/linux-inotify.c +++ b/src/unix/linux-inotify.c @@ -231,7 +231,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) { struct watcher_list* w; if (!uv__is_active(handle)) - return -EINVAL; + return 0; w = find_watcher(handle->loop, handle->wd); assert(w != NULL); diff --git a/src/unix/sunos.c b/src/unix/sunos.c index b8a39c70..a630dba7 100644 --- a/src/unix/sunos.c +++ b/src/unix/sunos.c @@ -431,7 +431,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, int uv_fs_event_stop(uv_fs_event_t* handle) { if (!uv__is_active(handle)) - return -EINVAL; + return 0; if (handle->fd == PORT_FIRED || handle->fd == PORT_LOADED) { port_dissociate(handle->loop->fs_fd, diff --git a/src/win/fs-event.c b/src/win/fs-event.c index f3de5756..7ad99a88 100644 --- a/src/win/fs-event.c +++ b/src/win/fs-event.c @@ -290,7 +290,7 @@ error: int uv_fs_event_stop(uv_fs_event_t* handle) { if (!uv__is_active(handle)) - return UV_EINVAL; + return 0; if (handle->dir_handle != INVALID_HANDLE_VALUE) { CloseHandle(handle->dir_handle);