unix: pass error to write callback in stream cleanup

This commit is contained in:
Ben Noordhuis 2011-09-16 02:05:50 +02:00 committed by Ryan Dahl
parent 4487531b06
commit 3c0684e832

View File

@ -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);
}
}
}