Skip to content

Commit

Permalink
- generic solution for comparing fd_set
Browse files Browse the repository at this point in the history
  • Loading branch information
sp-martin committed Jun 13, 2024
1 parent ef7e9b2 commit 1e742cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion port/linux/ipadapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,12 @@ fd_sets_are_equal(const fd_set *fd1, const fd_set *fd2)
return (memcmp(__FDS_BITS(fd1), __FDS_BITS(fd2), sizeof(__FDS_BITS(fd1))) ==
0);
#else //!__FDS_BITS
return (memcmp(fd1->fds_bits, fd2->fds_bits, sizeof(fd1->fds_bits)) == 0);
for (int i = 0; i < FD_SETSIZE; ++i) {
if (FD_ISSET(i, fd1) != FD_ISSET(i, fd2)) {
return false;
}
}
return true;
#endif //__FDS_BITS
}

Expand Down

0 comments on commit 1e742cb

Please sign in to comment.