Skip to content

Commit

Permalink
Merge pull request #7213 from sergio-nsk/patch-5
Browse files Browse the repository at this point in the history
mbedtls-2.28: Fix error: comparison of integers of different signs: 'SOCKET' and 'int'
  • Loading branch information
tom-cosgrove-arm authored Jul 7, 2023
2 parents e992af6 + 20003ca commit f788a45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/net_sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static int wsa_init_done = 0;
#include <errno.h>

#define IS_EINTR(ret) ((ret) == EINTR)
#define SOCKET int

#endif /* ( _WIN32 || _WIN32_WCE ) && !EFIX64 && !EFI32 */

Expand Down Expand Up @@ -494,13 +495,13 @@ int mbedtls_net_poll(mbedtls_net_context *ctx, uint32_t rw, uint32_t timeout)
FD_ZERO(&read_fds);
if (rw & MBEDTLS_NET_POLL_READ) {
rw &= ~MBEDTLS_NET_POLL_READ;
FD_SET(fd, &read_fds);
FD_SET((SOCKET) fd, &read_fds);
}

FD_ZERO(&write_fds);
if (rw & MBEDTLS_NET_POLL_WRITE) {
rw &= ~MBEDTLS_NET_POLL_WRITE;
FD_SET(fd, &write_fds);
FD_SET((SOCKET) fd, &write_fds);
}

if (rw != 0) {
Expand Down Expand Up @@ -608,7 +609,7 @@ int mbedtls_net_recv_timeout(void *ctx, unsigned char *buf,
}

FD_ZERO(&read_fds);
FD_SET(fd, &read_fds);
FD_SET((SOCKET) fd, &read_fds);

tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
Expand Down

0 comments on commit f788a45

Please sign in to comment.