summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-01 20:23:56 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-01 20:26:44 (GMT)
commit0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b (patch)
tree6c044f6b78006ff245e12ed6f47dcdcdf6d0676f /Source/cmSystemTools.cxx
parent1e26c84b96c0ec6887de2cf5e14061ccb83bdbfe (diff)
downloadCMake-0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b.zip
CMake-0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b.tar.gz
CMake-0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b.tar.bz2
cmake: Tolerate nullptr from uv_default_loop
`uv_default_loop()` can return `nullptr` when running on a Linux kernel configured without `CONFIG_EVENTFD`. Fixes: #20899
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index be799b0..2f08b84 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -823,7 +823,9 @@ void cmSystemTools::InitializeLibUV()
// Perform libuv one-time initialization now, and then un-do its
// global _fmode setting so that using libuv does not change the
// default file text/binary mode. See libuv issue 840.
- uv_loop_close(uv_default_loop());
+ if (uv_loop_t* loop = uv_default_loop()) {
+ uv_loop_close(loop);
+ }
# ifdef _MSC_VER
_set_fmode(_O_TEXT);
# else