unix,stream: fix returned error codes

PR-URL: https://github.com/libuv/libuv/pull/2427
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Santiago Gimeno 2019-08-15 23:25:09 +02:00
parent 9e80057051
commit 66132c66e4
No known key found for this signature in database
GPG Key ID: F28C3C8DA33C03BE

View File

@ -1403,7 +1403,7 @@ int uv_write2(uv_write_t* req,
return UV_EBADF;
if (!(stream->flags & UV_HANDLE_WRITABLE))
return -EPIPE;
return UV_EPIPE;
if (send_handle) {
if (stream->type != UV_NAMED_PIPE || !((uv_pipe_t*)stream)->ipc)
@ -1557,7 +1557,7 @@ int uv_read_start(uv_stream_t* stream,
return UV_EINVAL;
if (!(stream->flags & UV_HANDLE_READABLE))
return -ENOTCONN;
return UV_ENOTCONN;
/* The UV_HANDLE_READING flag is irrelevant of the state of the tcp - it just
* expresses the desired state of the user.