Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add assert and comment
  • Loading branch information
John Salem committed Jul 16, 2021
commit 90833acea8253a817c3d1c1c757b7df19c5f1b29
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 @@ -323,7 +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
fcntl(new_socket, F_SETFD, FD_CLOEXEC);
int fcntl_rc = fcntl(new_socket, F_SETFD, FD_CLOEXEC); // best effort; don't validate return value
EP_ASSERT (fcntl_rc != -1);
#endif // SOCK_CLOEXEC
DS_EXIT_BLOCKING_PAL_SECTION;
return new_socket;
Expand Down Expand Up @@ -351,7 +352,8 @@ ipc_socket_create_tcp (DiagnosticsIpc *ipc)
DS_ENTER_BLOCKING_PAL_SECTION;
new_socket = socket (ipc->server_address_family, socket_type, IPPROTO_TCP);
#ifndef SOCK_CLOEXEC
fcntl(new_socket, F_SETFD, FD_CLOEXEC);
int fcntl_rc = fcntl(new_socket, F_SETFD, FD_CLOEXEC); // best effort; don't validate return value
EP_ASSERT(fcntl_rc != -1);
#endif // SOCK_CLOEXEC
if (new_socket != DS_IPC_INVALID_SOCKET) {
int option_value = 1;
Expand Down