-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix Windows build of ds-ipc-pal-socket.c and remove EP_ASSERT around fcntl FD_CLOEXEC calls. #56141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -323,11 +323,8 @@ ipc_socket_create_uds (DiagnosticsIpc *ipc) | |
| DS_ENTER_BLOCKING_PAL_SECTION; | ||
| new_socket = socket (ipc->server_address_family, socket_type, 0); | ||
| #ifndef SOCK_CLOEXEC | ||
| if (new_socket != DS_IPC_INVALID_SOCKET) { | ||
| if (fcntl (new_socket, F_SETFD, FD_CLOEXEC) == -1) { | ||
| EP_ASSERT (!"Failed to set CLOEXEC"); | ||
| } | ||
| } | ||
| if (new_socket != DS_IPC_INVALID_SOCKET) | ||
| fcntl (new_socket, F_SETFD, FD_CLOEXEC); // ignore any failures; this is best effort | ||
| #endif // SOCK_CLOEXEC | ||
| DS_EXIT_BLOCKING_PAL_SECTION; | ||
| return new_socket; | ||
|
|
@@ -356,9 +353,9 @@ ipc_socket_create_tcp (DiagnosticsIpc *ipc) | |
| new_socket = socket (ipc->server_address_family, socket_type, IPPROTO_TCP); | ||
| if (new_socket != DS_IPC_INVALID_SOCKET) { | ||
| #ifndef SOCK_CLOEXEC | ||
| if (fcntl (new_socket, F_SETFD, FD_CLOEXEC) == -1) { | ||
| EP_ASSERT (!"Failed to set CLOEXEC"); | ||
| } | ||
| #ifndef HOST_WIN32 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should still check the existence of SOCK_CLOEXEC so we only do the fcntl call if we didn't already set it during the call to socket.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is already under
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, no I missed line 355 because I was reviewing this on my phone 🙄. If we're checking nit: |
||
| fcntl (new_socket, F_SETFD, FD_CLOEXEC); // ignore any failures; this is best effort | ||
| #endif // HOST_WIN32 | ||
| #endif // SOCK_CLOEXEC | ||
| int option_value = 1; | ||
| setsockopt (new_socket, IPPROTO_TCP, TCP_NODELAY, (const char*)&option_value, sizeof (option_value)); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.