From 174bb7776d3971e1ed91d57a47a7599b14c6eb45 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 8 Mar 2024 13:37:30 +0100 Subject: [PATCH] ntdll: Workaround sendmsg bug on macOS. There's a race on macOS when sending socket fd with sendmsg. The fd may get broken if it's closed before recvmsg is called. --- dlls/ntdll/unix/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 4342ac8ac454..2c6dc1b43ccd 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -846,7 +846,6 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ #endif wine_server_send_fd( socketfd[1] ); - close( socketfd[1] ); /* create the process on the server side */ @@ -875,6 +874,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_ process_info = wine_server_ptr_handle( reply->info ); } SERVER_END_REQ; + close( socketfd[1] ); free( objattr ); free( handles ); free( jobs );