Skip to content

Commit

Permalink
Fix ds-ipc-pal-socket.c Windows build. (dotnet#77840)
Browse files Browse the repository at this point in the history
Mainly build on mobile platforms, but beneficial if it works on Windows in order to test Mono TCP/IP EventPipe transport.
  • Loading branch information
lateralusX authored Feb 17, 2023
1 parent b01311b commit fc3303d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/native/eventpipe/ds-ipc-pal-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ ipc_socket_accept (
#endif
} while (ipc_retry_syscall (client_socket));

#ifndef HOST_WIN32
#if !HAVE_ACCEPT4 || !defined(SOCK_CLOEXEC)
#if defined(FD_CLOEXEC)
if (client_socket != -1)
Expand All @@ -545,6 +546,7 @@ ipc_socket_accept (
fcntl (client_socket, F_SETFD, FD_CLOEXEC);
}
#endif
#endif
#endif
DS_EXIT_BLOCKING_PAL_SECTION;
return client_socket;
Expand Down Expand Up @@ -632,7 +634,7 @@ ipc_socket_recv (
while (continue_recv && bytes_to_read - total_bytes_read > 0) {
current_bytes_read = recv (
s,
buffer_cursor,
(char *)buffer_cursor,
bytes_to_read - total_bytes_read,
0);
if (ipc_retry_syscall (current_bytes_read))
Expand Down Expand Up @@ -666,7 +668,7 @@ ipc_socket_send (
while (continue_send && bytes_to_write - total_bytes_written > 0) {
current_bytes_written = send (
s,
buffer_cursor,
(const char *)buffer_cursor,
bytes_to_write - total_bytes_written,
0);
if (ipc_retry_syscall (current_bytes_written))
Expand Down

0 comments on commit fc3303d

Please sign in to comment.