Skip to content

Commit

Permalink
net: sockets: Set writefds in case of error in select()
Browse files Browse the repository at this point in the history
The writefds is typically set if there is an error while
waiting for example the connect() to finish. So check if
the user supplied the writefds and update it accordingly.

Signed-off-by: Jukka Rissanen <[email protected]>
  • Loading branch information
jukkar authored and cfriedt committed Oct 24, 2023
1 parent ec4973d commit 5bf18e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions subsys/net/lib/sockets/sockets_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ int z_impl_zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds,
ZSOCK_FD_SET(fd, exceptfds);
num_selects++;
}

if (writefds != NULL) {
ZSOCK_FD_SET(fd, writefds);
num_selects++;
}
}

res--;
Expand Down

0 comments on commit 5bf18e3

Please sign in to comment.