unix: set proper loop errno for udp write req cb

Harmonize with stream.c and tcp.c: when a handle is closed that has pending
writes queued up, run the callbacks with loop->err.code set to UV_ECANCELED,
not UV_EINTR.
This commit is contained in:
Ben Noordhuis 2012-11-19 03:57:24 +01:00
parent 665a316aa9
commit 190db15638
2 changed files with 2 additions and 3 deletions

View File

@ -68,8 +68,7 @@ void uv__udp_finish_close(uv_udp_t* handle) {
req->bufs = NULL;
if (req->send_cb) {
/* FIXME proper error code like UV_EABORTED */
uv__set_artificial_error(handle->loop, UV_EINTR);
uv__set_artificial_error(handle->loop, UV_ECANCELED);
req->send_cb(req, -1);
}
}

View File

@ -73,7 +73,7 @@ static void send_cb(uv_udp_send_t* req, int status) {
if (status != 0) {
ASSERT(status == -1);
ASSERT(uv_last_error(req->handle->loop).code == UV_EINTR);
ASSERT(uv_last_error(req->handle->loop).code == UV_ECANCELED);
return;
}