Fix ds-ipc-pal-socket.c Windows build. (#77840)
authorJohan Lorensson <lateralusx.github@gmail.com>
Fri, 17 Feb 2023 10:37:11 +0000 (11:37 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Feb 2023 10:37:11 +0000 (11:37 +0100)
Mainly build on mobile platforms, but beneficial if it works on Windows in order to test Mono TCP/IP EventPipe transport.

src/native/eventpipe/ds-ipc-pal-socket.c

index d7aa4d0..ca7b828 100644 (file)
@@ -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)
@@ -546,6 +547,7 @@ ipc_socket_accept (
                }
 #endif
 #endif
+#endif
        DS_EXIT_BLOCKING_PAL_SECTION;
        return client_socket;
 }
@@ -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))
@@ -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))