Skip to content

Commit

Permalink
Fix FDSET issue
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
  • Loading branch information
roncapat committed Nov 14, 2021
1 parent 7fe7719 commit 8ea7240
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/c/profile/transport/ip/tcp/tcp_transport_rtems_bsd_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,11 @@ bool uxr_init_tcp_platform(
rv = true;

/* Server connection. */
if (rv)
{
int connected = connect(platform->fd,
(struct sockaddr *)&platform->remote_addr,
sizeof(platform->remote_addr));
rv = (0 == connected);
}
else
{
rv = false;
}
int connected = connect(platform->fd,
(struct sockaddr *)&platform->remote_addr,
sizeof(platform->remote_addr));
rv = (0 == connected);
}

return rv;
}

Expand Down Expand Up @@ -113,6 +105,11 @@ size_t uxr_read_tcp_data_platform(
tv.tv_sec = timeout/1000;
tv.tv_usec = (timeout%1000) *1000;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
FD_ZERO(&platform->select_fd);
FD_SET(platform->fd, &platform->select_fd);
#pragma GCC diagnostic pop
int32_t poll_rv = select(platform->fd+1, &platform->select_fd, NULL, NULL, &tv);
if (0 < poll_rv)
{
Expand Down
5 changes: 5 additions & 0 deletions src/c/profile/transport/ip/udp/udp_transport_rtems_bsd_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ size_t uxr_read_udp_data_platform(
tv.tv_sec = timeout/1000;
tv.tv_usec = (timeout%1000) *1000;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
FD_ZERO(&platform->select_fd);
FD_SET(platform->fd, &platform->select_fd);
#pragma GCC diagnostic pop
int32_t poll_rv = select(platform->fd+1, &platform->select_fd, NULL, NULL, &tv);
if (0 < poll_rv)
{
Expand Down

0 comments on commit 8ea7240

Please sign in to comment.