summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-02 14:59:09 (GMT)
committerBrad King <brad.king@kitware.com>2018-05-02 15:16:19 (GMT)
commit1c22fdf36037e9c65bad38ee36d346fe7691283b (patch)
treee970e5bb978a6e5c3747590ad31144ef8caf7096 /Utilities
parentfbe6cd1596bf280edd49aeb8f981f99d7cd8beb3 (diff)
downloadCMake-1c22fdf36037e9c65bad38ee36d346fe7691283b.zip
CMake-1c22fdf36037e9c65bad38ee36d346fe7691283b.tar.gz
CMake-1c22fdf36037e9c65bad38ee36d346fe7691283b.tar.bz2
libuv: linux/sparc64: use fcntl to set and clear O_NONBLOCK
Upstream libuv commits: * node-v0.6.0~28 (linux: use ioctl(FIONBIO) to set O_NONBLOCK, saves a syscall, 2011-10-29) * v1.11.0~11 (unix: use async-signal safe functions between fork and exec, 2016-12-12) left an asymmetry in the way O_NONBLOCK is set and cleared. Normally ioctl/FIONBIO is used for both. However, uv_spawn uses fcntl/O_NONBLOCK to clear O_NONBLOCK between fork and exec. This fails on Linux/sparc64 where setting via ioctl/FIONBIO actually sets two bits (in O_NDELAY) that cause clearing via fcntl/O_NONBLOCK to be silently ignored (though clearing via ioctl/FIONBIO or fcntl/O_NDELAY works). Since CMake commit v3.11.0-rc1~117^2 (CTest: Re-implement test process handling using libuv, 2017-12-10), CTest uses libuv. On Linux/sparc64 child processes have been started with non-blocking output pipes. This can lead to write errors or lost output from children not prepared to deal with `EAGAIN` on stdout or stderr. Fix this for now by switching libuv back to fcntl/O_NONBLOCK to set and clear O_NONBLOCK when compiled on Linux/sparc64. LibUV-Issue: 1830 Fixes: #17941
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibuv/src/unix/internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Utilities/cmlibuv/src/unix/internal.h b/Utilities/cmlibuv/src/unix/internal.h
index 9cc87f0..668e576 100644
--- a/Utilities/cmlibuv/src/unix/internal.h
+++ b/Utilities/cmlibuv/src/unix/internal.h
@@ -184,7 +184,7 @@ struct uv__stream_queued_fds_s {
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || \
- defined(__linux__) || \
+ (defined(__linux__) && !defined(__sparc__)) || \
defined(__OpenBSD__) || \
defined(__NetBSD__)
#define uv__cloexec uv__cloexec_ioctl