Skip to content

Commit 24712a0

Browse files
Merge pull request #1881 from contour-terminal/fix/alpine-linux-build
Fix build failure on Alpine Linux (musl libc)
2 parents 141407c + acd2ef7 commit 24712a0

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

.github/actions/spelling/allow/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FFFFFFFF
1111
FONTBOUNDINGBOX
1212
FreeBSD
1313
LASTEXITCODE
14+
RTX
1415
OPENCONSOLE
1516
OpenBSD
1617
RTX

metainfo.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<release version="0.6.3" urgency="medium" type="development">
108108
<description>
109109
<ul>
110+
<li>Fixes build failure on Alpine Linux (musl libc) due to missing close_range() function (#1879)</li>
110111
<li>Fixes Insert Replace Mode (IRM, CSI 4 h) not shifting text right on character insertion (#1877)</li>
111112
<li>Fixes Home/End key encoding in Kitty keyboard protocol (extended keyboard input generator)</li>
112113
<li>Fixes glyph scaling and vertical centering of colored emoji</li>

src/vtpty/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ if(LINUX)
5757
endif()
5858

5959
if(UNIX)
60+
include(CheckFunctionExists)
61+
check_function_exists(close_range HAVE_CLOSE_RANGE)
62+
6063
list(APPEND vtpty_LIBRARIES util)
6164
list(APPEND vtpty_SOURCES UnixPty.cpp UnixUtils.cpp)
6265
list(APPEND vtpty_SOURCES UnixPty.h UnixUtils.h)
@@ -71,6 +74,9 @@ set_target_properties(vtpty PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
7174
if(CONTOUR_WITH_UTEMPTER)
7275
target_compile_definitions(vtpty PRIVATE UTEMPTER=1)
7376
endif()
77+
if(HAVE_CLOSE_RANGE)
78+
target_compile_definitions(vtpty PRIVATE HAVE_CLOSE_RANGE)
79+
endif()
7480
if(_include_SshSession_module)
7581
target_compile_definitions(vtpty PUBLIC VTPTY_LIBSSH2=1)
7682
endif()

src/vtpty/Process_unix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace
8080

8181
void closeAllFileDescriptorsAbove(int keepFd)
8282
{
83-
#if defined(__linux__) || defined(__FreeBSD__)
83+
#if defined(HAVE_CLOSE_RANGE)
8484
if (close_range(keepFd + 1, ~0U, 0) == 0)
8585
return;
8686
#endif

0 commit comments

Comments
 (0)