diff --git a/include/uv.h b/include/uv.h index dd394eb9..fa4bbb52 100644 --- a/include/uv.h +++ b/include/uv.h @@ -552,7 +552,7 @@ UV_EXTERN int uv_is_writable(uv_stream_t* handle); * and the arrival of the close callback, and cannot be used * to validate the handle. */ -UV_EXTERN int uv_is_closing(uv_handle_t* handle); +UV_EXTERN int uv_is_closing(const uv_handle_t* handle); /* diff --git a/src/unix/core.c b/src/unix/core.c index 7bd91465..5ad639cc 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -118,7 +118,7 @@ void uv_close(uv_handle_t* handle, uv_close_cb close_cb) { } -int uv_is_closing(uv_handle_t* handle) { +int uv_is_closing(const uv_handle_t* handle) { return handle->flags & (UV_CLOSING | UV_CLOSED); } diff --git a/src/win/handle.c b/src/win/handle.c index 737b6375..797b0716 100644 --- a/src/win/handle.c +++ b/src/win/handle.c @@ -154,7 +154,7 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) { } -int uv_is_closing(uv_handle_t* handle) { +int uv_is_closing(const uv_handle_t* handle) { return handle->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED); }