From 66132c66e475c381d7ab2d127852310bfb3069a8 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Thu, 15 Aug 2019 23:25:09 +0200 Subject: [PATCH] unix,stream: fix returned error codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/libuv/libuv/pull/2427 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Saúl Ibarra Corretgé --- 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 9de01e3c..55b753c0 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -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.