diff options
author | Brad King <brad.king@kitware.com> | 2017-02-22 00:38:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-22 00:40:27 (GMT) |
commit | 741b7621b3c71406359d75098f9bdf8d3567662f (patch) | |
tree | 67bdab23eb2238c175282a275ec08f2dd9431226 /Utilities/cmlibuv/src/unix/stream.c | |
parent | 3ccad39000281c40e2a7a5e078adc4f977e462dd (diff) | |
parent | 1f661e87a6a8304edb77bd30b546e5d113477c59 (diff) | |
download | CMake-741b7621b3c71406359d75098f9bdf8d3567662f.zip CMake-741b7621b3c71406359d75098f9bdf8d3567662f.tar.gz CMake-741b7621b3c71406359d75098f9bdf8d3567662f.tar.bz2 |
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
libuv 2017-02-21 (52ae8264)
Diffstat (limited to 'Utilities/cmlibuv/src/unix/stream.c')
-rw-r--r-- | Utilities/cmlibuv/src/unix/stream.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/Utilities/cmlibuv/src/unix/stream.c b/Utilities/cmlibuv/src/unix/stream.c index d20d0bc..7059df1 100644 --- a/Utilities/cmlibuv/src/unix/stream.c +++ b/Utilities/cmlibuv/src/unix/stream.c @@ -390,7 +390,7 @@ failed_malloc: int uv__stream_open(uv_stream_t* stream, int fd, int flags) { -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__MVS__) int enable; #endif @@ -409,7 +409,7 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) { return -errno; } -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__MVS__) enable = 1; if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) && errno != ENOTSOCK && @@ -1194,6 +1194,30 @@ static void uv__read(uv_stream_t* stream) { return; } } + +#if defined(__MVS__) + if (is_ipc && msg.msg_controllen > 0) { + uv_buf_t blankbuf; + int nread; + struct iovec *old; + + blankbuf.base = 0; + blankbuf.len = 0; + old = msg.msg_iov; + msg.msg_iov = (struct iovec*) &blankbuf; + nread = 0; + do { + nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0); + err = uv__stream_recv_cmsg(stream, &msg); + if (err != 0) { + stream->read_cb(stream, err, &buf); + msg.msg_iov = old; + return; + } + } while (nread == 0 && msg.msg_controllen > 0); + msg.msg_iov = old; + } +#endif stream->read_cb(stream, nread, &buf); /* Return if we didn't fill the buffer, there is no more data to read. */ @@ -1221,8 +1245,7 @@ int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) { if (!(stream->flags & UV_STREAM_WRITABLE) || stream->flags & UV_STREAM_SHUT || stream->flags & UV_STREAM_SHUTTING || - stream->flags & UV_CLOSED || - stream->flags & UV_CLOSING) { + uv__is_closing(stream)) { return -ENOTCONN; } |