From 2303471ffa736c378e2a89bc1c0274076c56edfd Mon Sep 17 00:00:00 2001 From: Shreeyash Pandey Date: Sun, 2 Nov 2025 17:21:01 +0530 Subject: [PATCH 1/2] [libc] fix EXPECT_EXIT suspend/timeout for darwin Fixes: https://github.com/llvm/llvm-project/issues/166059 Signed-off-by: Shreeyash Pandey --- libc/test/UnitTest/ExecuteFunctionUnix.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/test/UnitTest/ExecuteFunctionUnix.cpp b/libc/test/UnitTest/ExecuteFunctionUnix.cpp index c0e85c2144005..0b450578adde2 100644 --- a/libc/test/UnitTest/ExecuteFunctionUnix.cpp +++ b/libc/test/UnitTest/ExecuteFunctionUnix.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -58,7 +59,7 @@ ProcessStatus invoke_in_subprocess(FunctionCaller *func, int timeout_ms) { ::close(pipe_fds[1]); struct pollfd poll_fd { - pipe_fds[0], 0, 0 + pipe_fds[0], POLLIN, 0 }; // No events requested so this call will only return after the timeout or if // the pipes peer was closed, signaling the process exited. From d8b29b6fad56a2dbd9a2c6aa8b393433470cd1df Mon Sep 17 00:00:00 2001 From: Shreeyash Pandey Date: Sun, 2 Nov 2025 18:50:43 +0530 Subject: [PATCH 2/2] [libc] fix formatting --- libc/test/UnitTest/ExecuteFunctionUnix.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libc/test/UnitTest/ExecuteFunctionUnix.cpp b/libc/test/UnitTest/ExecuteFunctionUnix.cpp index 0b450578adde2..7c2eb7c6e887c 100644 --- a/libc/test/UnitTest/ExecuteFunctionUnix.cpp +++ b/libc/test/UnitTest/ExecuteFunctionUnix.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -58,9 +57,7 @@ ProcessStatus invoke_in_subprocess(FunctionCaller *func, int timeout_ms) { } ::close(pipe_fds[1]); - struct pollfd poll_fd { - pipe_fds[0], POLLIN, 0 - }; + struct pollfd poll_fd{pipe_fds[0], POLLIN, 0}; // No events requested so this call will only return after the timeout or if // the pipes peer was closed, signaling the process exited. if (::poll(&poll_fd, 1, timeout_ms) == -1) {