Permalink
Browse files

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.
  • Loading branch information...
1 parent 665a316 commit 190db15638ef7f9eebf0b5160313991898480d7f @bnoordhuis bnoordhuis committed Nov 19, 2012
Showing with 2 additions and 3 deletions.
  1. +1 −2 src/unix/udp.c
  2. +1 −1 test/benchmark-udp-pummel.c
View
@@ -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);
}
}
@@ -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;
}

0 comments on commit 190db15

Please sign in to comment.