Skip to content

Commit

Permalink
fix missed fd_set
Browse files Browse the repository at this point in the history
  • Loading branch information
john30 committed Mar 27, 2024
1 parent 866a71f commit 033586c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/ebus/transport.cpp
Expand Up @@ -176,6 +176,7 @@ result_t FileTransport::read(unsigned int timeout, const uint8_t** data, size_t*
FD_ZERO(&readfds);
FD_ZERO(&exceptfds);
FD_SET(m_fd, &readfds);
FD_SET(m_fd, &exceptfds);

ret = pselect(m_fd + 1, &readfds, nullptr, &exceptfds, &tdiff, nullptr);
if (ret >= 1 && FD_ISSET(m_fd, &exceptfds)) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/tcpsocket.cpp
Expand Up @@ -160,6 +160,8 @@ int tcpKeepAliveInterval) {
FD_ZERO(&writefds);
FD_ZERO(&exceptfds);
FD_SET(sfd, &readfds);
FD_SET(sfd, &writefds);
FD_SET(sfd, &exceptfds);
#ifdef HAVE_PSELECT
ret = pselect(sfd + 1, &readfds, &writefds, &exceptfds, &tdiff, nullptr);
#else
Expand Down

0 comments on commit 033586c

Please sign in to comment.