unix, windows: avoid error in uv_fs_event_stop

For consistency with other handle types, if stop is called while the
handle wasn't started yet, it's a no-op.
This commit is contained in:
Saúl Ibarra Corretgé 2014-05-12 23:46:56 +02:00
parent ecaede660c
commit 1579788c50
4 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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);