Skip to content

Commit 3e13465

Browse files
iinozemtsevCommit Queue
authored andcommitted
Fix -Wunguarded-availability on Android
TEST=ci Bug: b/417433829 Change-Id: I064c1c2c772ffd579b9e15b13333fb2cb8344f3d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428321 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Ivan Inozemtsev <[email protected]>
1 parent 922cdf4 commit 3e13465

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

runtime/bin/process_linux.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,13 @@ extern "C" int close_range(unsigned int first, unsigned int last, int flags)
287287
__attribute__((weak));
288288

289289
void CloseAllButStdioAndExecControl(int exec_control_fd) {
290+
#if defined(DART_HOST_OS_ANDROID)
291+
if (__builtin_available(android 34, *)) {
292+
#elif defined(DART_HOST_OS_LINUX)
290293
if (&close_range != nullptr) {
294+
#else
295+
#error "DART_HOST_OS_LINUX or DART_HOST_OS_ANDROID must be defined"
296+
#endif
291297
close_range(3, exec_control_fd - 1, 0);
292298
close_range(exec_control_fd + 1, ~0u, 0);
293299
} else {

0 commit comments

Comments
 (0)