Skip to content

Commit cb7df81

Browse files
committed
Remove unnessary __darwin_check_fd_set_overflow call
1 parent 27fb8c0 commit cb7df81

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Sources/OpenGraphCxx/DebugServer/DebugServer.mm

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@
146146

147147
// Add the server socket to the fd_set
148148
int server_fd = sockfd;
149-
if (__darwin_check_fd_set_overflow(server_fd, &writefds, 0)) {
150-
FD_SET(server_fd, &writefds);
151-
}
149+
FD_SET(server_fd, &writefds);
152150

153151
// Find the maximum file descriptor and add all connection sockets
154152
int max_fd = server_fd;
@@ -158,9 +156,7 @@
158156
auto connection_data = connections.data();
159157
for (size_t i = 0; i < connection_count; ++i) {
160158
int conn_fd = connection_data[i]->sockfd;
161-
if (__darwin_check_fd_set_overflow(conn_fd, &writefds, 0)) {
162-
FD_SET(conn_fd, &writefds);
163-
}
159+
FD_SET(conn_fd, &writefds);
164160
if (max_fd < conn_fd) {
165161
max_fd = conn_fd;
166162
}
@@ -181,10 +177,9 @@
181177
// Continue the loop on EAGAIN
182178
continue;
183179
}
184-
180+
185181
// Check if server socket is ready for new connections
186-
if (__darwin_check_fd_set_overflow(server_fd, &writefds, 0) &&
187-
FD_ISSET(server_fd, &writefds)) {
182+
if (FD_ISSET(server_fd, &writefds)) {
188183
accept_handler((void *)this);
189184
accepted_connection = true;
190185
}
@@ -196,8 +191,7 @@
196191
auto connection = connections.data()[i].get();
197192
int conn_fd = connection->sockfd;
198193

199-
if (__darwin_check_fd_set_overflow(conn_fd, &writefds, 0) &&
200-
FD_ISSET(conn_fd, &writefds)) {
194+
if (FD_ISSET(conn_fd, &writefds)) {
201195

202196
// Clear the FD from the set before processing
203197
FD_CLR(conn_fd, &writefds);

0 commit comments

Comments
 (0)