diff --git a/deps/uv/test/test-timer-again.c b/deps/uv/test/test-timer-again.c index 3d568e542b8..1585c09d6cf 100644 --- a/deps/uv/test/test-timer-again.c +++ b/deps/uv/test/test-timer-again.c @@ -77,12 +77,7 @@ static void repeat_2_cb(uv_handle_t* handle, int status) { repeat_2_cb_called++; if (uv_timer_get_repeat(handle) == 0) { - /* XXX Libev does considers the timer active here. - * I'm not saying it must be this way, but we should consider what - * exactly the semantics of uv_is_active() should be. Is a timer that's - * initialized but stopped active? - */ - ASSERT(uv_is_active(handle)); + ASSERT(!uv_is_active(handle)); uv_close(handle); return; } diff --git a/deps/uv/uv-unix.c b/deps/uv/uv-unix.c index d0511b1306a..c92e6492d3c 100644 --- a/deps/uv/uv-unix.c +++ b/deps/uv/uv-unix.c @@ -1092,10 +1092,17 @@ int uv_idle_stop(uv_handle_t* handle) { int uv_is_active(uv_handle_t* handle) { switch (handle->type) { + case UV_TIMER: + return ev_is_active(&handle->timer_watcher); + case UV_PREPARE: + return ev_is_active(&handle->prepare_watcher); + case UV_CHECK: + return ev_is_active(&handle->check_watcher); + case UV_IDLE: - return ev_is_active(handle); + return ev_is_active(&handle->idle_watcher); default: return 1;