1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge remote-tracking branch 'upstream-public/pr/895' into development

This commit is contained in:
Gilles Peskine
2017-11-29 20:49:21 +01:00
2 changed files with 8 additions and 1 deletions

View File

@ -270,13 +270,18 @@ static int net_would_block( const mbedtls_net_context *ctx )
*/
static int net_would_block( const mbedtls_net_context *ctx )
{
int err = errno;
/*
* Never return 'WOULD BLOCK' on a non-blocking socket
*/
if( ( fcntl( ctx->fd, F_GETFL ) & O_NONBLOCK ) != O_NONBLOCK )
{
errno = err;
return( 0 );
}
switch( errno )
switch( errno = err )
{
#if defined EAGAIN
case EAGAIN: