aboutsummaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/unix/stream.c')
-rw-r--r--deps/uv/src/unix/stream.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c
index 3e786abee0..5ec6bf4de2 100644
--- a/deps/uv/src/unix/stream.c
+++ b/deps/uv/src/unix/stream.c
@@ -1417,6 +1417,9 @@ int uv_write2(uv_write_t* req,
if (uv__stream_fd(stream) < 0)
return UV_EBADF;
+ if (!(stream->flags & UV_STREAM_WRITABLE))
+ return -EPIPE;
+
if (send_handle) {
if (stream->type != UV_NAMED_PIPE || !((uv_pipe_t*)stream)->ipc)
return UV_EINVAL;
@@ -1568,6 +1571,9 @@ int uv_read_start(uv_stream_t* stream,
if (stream->flags & UV_CLOSING)
return UV_EINVAL;
+ if (!(stream->flags & UV_STREAM_READABLE))
+ return -ENOTCONN;
+
/* The UV_STREAM_READING flag is irrelevant of the state of the tcp - it just
* expresses the desired state of the user.
*/