From 80e06d77d95329c1a43e7d9dba73e289bdeec1ec Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 15 Mar 2018 14:41:55 +0000 Subject: [PATCH] Use WSAEINTR instead of EINTR on Windows --- library/net_sockets.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/net_sockets.c b/library/net_sockets.c index e63e496b9..96cfa35cd 100644 --- a/library/net_sockets.c +++ b/library/net_sockets.c @@ -474,7 +474,13 @@ int mbedtls_net_poll( mbedtls_net_context *ctx, uint32_t rw, uint32_t timeout ) { ret = select( fd + 1, &read_fds, &write_fds, NULL, timeout == (uint32_t) -1 ? NULL : &tv ); - } while( ret == EINTR ); + } +#if ( defined(_WIN32) || defined(_WIN32_WCE) ) && !defined(EFIX64) && \ + !defined(EFI32) + while( ret == WSAEINTR ); +#else + while( ret == EINTR ); +#endif if( ret < 0 ) return( MBEDTLS_ERR_NET_POLL_FAILED );