From a8d2613ba017d8daace82af82543181172a9fdc2 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 23 Aug 2011 20:39:24 +0200 Subject: [PATCH] win: integrate uv_close_error into uv_close --- src/win/handle.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/win/handle.c b/src/win/handle.c index f75eeb8c..715cec46 100644 --- a/src/win/handle.c +++ b/src/win/handle.c @@ -39,8 +39,7 @@ int uv_is_active(uv_handle_t* handle) { } -/* TODO: integrate this with uv_close. */ -static void uv_close_error(uv_handle_t* handle, uv_err_t e) { +void uv_close(uv_handle_t* handle, uv_close_cb cb) { uv_tcp_t* tcp; uv_pipe_t* pipe; uv_process_t* process; @@ -49,8 +48,8 @@ static void uv_close_error(uv_handle_t* handle, uv_err_t e) { return; } - handle->error = e; handle->flags |= UV_HANDLE_CLOSING; + handle->close_cb = cb; /* Handle-specific close actions */ switch (handle->type) { @@ -116,12 +115,6 @@ static void uv_close_error(uv_handle_t* handle, uv_err_t e) { } -void uv_close(uv_handle_t* handle, uv_close_cb close_cb) { - handle->close_cb = close_cb; - uv_close_error(handle, uv_ok_); -} - - void uv_want_endgame(uv_handle_t* handle) { if (!(handle->flags & UV_HANDLE_ENDGAME_QUEUED)) { handle->flags |= UV_HANDLE_ENDGAME_QUEUED;