diff options
author | Brad King <brad.king@kitware.com> | 2017-05-26 17:33:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-26 17:33:41 (GMT) |
commit | 1ebb421bfc8eb21a4e5e56e501a62d000a9f59db (patch) | |
tree | af67fb0fc045f87b37b891b495ff48e58262283b /Utilities/cmlibuv/src/unix/stream.c | |
parent | bc407ba6ba28293b5fc0025fa08e8fe71365eab8 (diff) | |
parent | 362435f02a52008a90a1c19862f09b01f1b5bd7f (diff) | |
download | CMake-1ebb421bfc8eb21a4e5e56e501a62d000a9f59db.zip CMake-1ebb421bfc8eb21a4e5e56e501a62d000a9f59db.tar.gz CMake-1ebb421bfc8eb21a4e5e56e501a62d000a9f59db.tar.bz2 |
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
libuv 2017-05-25 (dc596109)
Diffstat (limited to 'Utilities/cmlibuv/src/unix/stream.c')
-rw-r--r-- | Utilities/cmlibuv/src/unix/stream.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Utilities/cmlibuv/src/unix/stream.c b/Utilities/cmlibuv/src/unix/stream.c index dbd04f2..7b23d16 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__) || defined(__MVS__) +#if defined(__APPLE__) int enable; #endif @@ -409,7 +409,7 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) { return -errno; } -#if defined(__APPLE__) || defined(__MVS__) +#if defined(__APPLE__) enable = 1; if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) && errno != ENOTSOCK && @@ -1173,6 +1173,11 @@ static void uv__read(uv_stream_t* stream) { uv__stream_osx_interrupt_select(stream); } stream->read_cb(stream, 0, &buf); +#if defined(__CYGWIN__) || defined(__MSYS__) + } else if (errno == ECONNRESET && stream->type == UV_NAMED_PIPE) { + uv__stream_eof(stream, &buf); + return; +#endif } else { /* Error. User should call uv_close(). */ stream->read_cb(stream, -errno, &buf); @@ -1405,6 +1410,12 @@ int uv_write2(uv_write_t* req, */ if (uv__handle_fd((uv_handle_t*) send_handle) < 0) return -EBADF; + +#if defined(__CYGWIN__) || defined(__MSYS__) + /* Cygwin recvmsg always sets msg_controllen to zero, so we cannot send it. + See https://github.com/mirror/newlib-cygwin/blob/86fc4bf0/winsup/cygwin/fhandler_socket.cc#L1736-L1743 */ + return -ENOSYS; +#endif } /* It's legal for write_queue_size > 0 even when the write_queue is empty; |