Lines Matching refs:ret

54 #define IS_EINTR( ret ) ( ( ret ) == WSAEINTR )  argument
96 #define IS_EINTR( ret ) ( ( ret ) == EINTR ) argument
177 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_connect() local
180 if( ( ret = net_prepare() ) != 0 ) in mbedtls_net_connect()
181 return( ret ); in mbedtls_net_connect()
193 ret = MBEDTLS_ERR_NET_UNKNOWN_HOST; in mbedtls_net_connect()
200 ret = MBEDTLS_ERR_NET_SOCKET_FAILED; in mbedtls_net_connect()
206 ret = 0; in mbedtls_net_connect()
211 ret = MBEDTLS_ERR_NET_CONNECT_FAILED; in mbedtls_net_connect()
216 return( ret ); in mbedtls_net_connect()
224 int n, ret; in mbedtls_net_bind() local
227 if( ( ret = net_prepare() ) != 0 ) in mbedtls_net_bind()
228 return( ret ); in mbedtls_net_bind()
242 ret = MBEDTLS_ERR_NET_UNKNOWN_HOST; in mbedtls_net_bind()
249 ret = MBEDTLS_ERR_NET_SOCKET_FAILED; in mbedtls_net_bind()
258 ret = MBEDTLS_ERR_NET_SOCKET_FAILED; in mbedtls_net_bind()
265 ret = MBEDTLS_ERR_NET_BIND_FAILED; in mbedtls_net_bind()
275 ret = MBEDTLS_ERR_NET_LISTEN_FAILED; in mbedtls_net_bind()
281 ret = 0; in mbedtls_net_bind()
287 return( ret ); in mbedtls_net_bind()
343 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_accept() local
369 ret = client_ctx->fd = (int) accept( bind_ctx->fd, in mbedtls_net_accept()
377 ret = (int) recvfrom( bind_ctx->fd, buf, sizeof( buf ), MSG_PEEK, in mbedtls_net_accept()
381 if( ret == SOCKET_ERROR && in mbedtls_net_accept()
385 ret = 0; in mbedtls_net_accept()
390 if( ret < 0 ) in mbedtls_net_accept()
486 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_poll() local
494 ret = check_fd( fd, 1 ); in mbedtls_net_poll()
495 if( ret != 0 ) in mbedtls_net_poll()
496 return( ret ); in mbedtls_net_poll()
530 ret = select( fd + 1, &read_fds, &write_fds, NULL, in mbedtls_net_poll()
533 while( IS_EINTR( ret ) ); in mbedtls_net_poll()
535 if( ret < 0 ) in mbedtls_net_poll()
538 ret = 0; in mbedtls_net_poll()
540 ret |= MBEDTLS_NET_POLL_READ; in mbedtls_net_poll()
542 ret |= MBEDTLS_NET_POLL_WRITE; in mbedtls_net_poll()
544 return( ret ); in mbedtls_net_poll()
572 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_recv() local
575 ret = check_fd( fd, 0 ); in mbedtls_net_recv()
576 if( ret != 0 ) in mbedtls_net_recv()
577 return( ret ); in mbedtls_net_recv()
579 ret = (int) read( fd, buf, len ); in mbedtls_net_recv()
581 if( ret < 0 ) in mbedtls_net_recv()
601 return( ret ); in mbedtls_net_recv()
610 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_recv_timeout() local
615 ret = check_fd( fd, 1 ); in mbedtls_net_recv_timeout()
616 if( ret != 0 ) in mbedtls_net_recv_timeout()
617 return( ret ); in mbedtls_net_recv_timeout()
625 ret = select( fd + 1, &read_fds, NULL, NULL, timeout == 0 ? NULL : &tv ); in mbedtls_net_recv_timeout()
628 if( ret == 0 ) in mbedtls_net_recv_timeout()
631 if( ret < 0 ) in mbedtls_net_recv_timeout()
654 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_send() local
657 ret = check_fd( fd, 0 ); in mbedtls_net_send()
658 if( ret != 0 ) in mbedtls_net_send()
659 return( ret ); in mbedtls_net_send()
661 ret = (int) write( fd, buf, len ); in mbedtls_net_send()
663 if( ret < 0 ) in mbedtls_net_send()
683 return( ret ); in mbedtls_net_send()