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:
parent
ecaede660c
commit
1579788c50
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user