From 3c0684e8324f3fad48fc1bb7f6dd3e46ce1b272f Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 16 Sep 2011 02:05:50 +0200 Subject: [PATCH] unix: pass error to write callback in stream cleanup --- src/unix/stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix/stream.c b/src/unix/stream.c index a5d860d0..a4bcde3b 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -129,8 +129,8 @@ void uv__stream_destroy(uv_stream_t* stream) { req = ngx_queue_data(q, uv_write_t, queue); if (req->cb) { - uv_err_new_artificial(req->handle->loop, UV_OK); - req->cb(req, 0); + uv_err_new_artificial(stream->loop, req->error); + req->cb(req, req->error ? -1 : 0); } } }