win: fix UV_EALREADY incorrectly set

UV_EALREADY itself is already a libuv error, it should be set with
uv__set_artifical_error and not with uv__set_sys_error.

Closes #802
This commit is contained in:
Bert Belder 2013-05-18 20:45:36 +02:00
parent d5fa633ef2
commit db7dc6899d

View File

@ -56,7 +56,7 @@ int uv_accept(uv_stream_t* server, uv_stream_t* client) {
int uv_read_start(uv_stream_t* handle, uv_alloc_cb alloc_cb,
uv_read_cb read_cb) {
if (handle->flags & UV_HANDLE_READING) {
uv__set_sys_error(handle->loop, UV_EALREADY);
uv__set_artificial_error(handle->loop, UV_EALREADY);
return -1;
}
@ -82,7 +82,7 @@ int uv_read_start(uv_stream_t* handle, uv_alloc_cb alloc_cb,
int uv_read2_start(uv_stream_t* handle, uv_alloc_cb alloc_cb,
uv_read2_cb read_cb) {
if (handle->flags & UV_HANDLE_READING) {
uv__set_sys_error(handle->loop, UV_EALREADY);
uv__set_artificial_error(handle->loop, UV_EALREADY);
return -1;
}