diff --git a/include/uv.h b/include/uv.h index b9e5140d2..dd394eb9c 100644 --- a/include/uv.h +++ b/include/uv.h @@ -400,7 +400,7 @@ UV_EXTERN size_t uv_req_size(uv_req_type type); * Returns 1 if the prepare/check/idle/timer handle has been started, 0 * otherwise. For other handle types this always returns 1. */ -UV_EXTERN int uv_is_active(uv_handle_t* handle); +UV_EXTERN int uv_is_active(const uv_handle_t* handle); /* * Request handle to be closed. close_cb will be called asynchronously after diff --git a/src/unix/core.c b/src/unix/core.c index 5d5048ad3..7bd914657 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -289,16 +289,16 @@ void uv__req_init(uv_loop_t* loop, uv_req_t* req) { } -int uv_is_active(uv_handle_t* handle) { +int uv_is_active(const uv_handle_t* handle) { switch (handle->type) { case UV_CHECK: - return uv__check_active((uv_check_t*)handle); + return uv__check_active((const uv_check_t*)handle); case UV_IDLE: - return uv__idle_active((uv_idle_t*)handle); + return uv__idle_active((const uv_idle_t*)handle); case UV_PREPARE: - return uv__prepare_active((uv_prepare_t*)handle); + return uv__prepare_active((const uv_prepare_t*)handle); case UV_TIMER: - return uv__timer_active((uv_timer_t*)handle); + return uv__timer_active((const uv_timer_t*)handle); default: return 1; } diff --git a/src/win/handle.c b/src/win/handle.c index d19492c0e..737b6375f 100644 --- a/src/win/handle.c +++ b/src/win/handle.c @@ -56,7 +56,7 @@ uv_handle_type uv_guess_handle(uv_file file) { } -int uv_is_active(uv_handle_t* handle) { +int uv_is_active(const uv_handle_t* handle) { switch (handle->type) { case UV_TIMER: case UV_IDLE: