Lines Matching refs:ret

38 #define IS_EINTR(ret) ((ret) == WSAEINTR)  argument
75 #define IS_EINTR(ret) ((ret) == EINTR) argument
161 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_connect() local
164 if ((ret = net_prepare()) != 0) { in mbedtls_net_connect()
165 return ret; in mbedtls_net_connect()
179 ret = MBEDTLS_ERR_NET_UNKNOWN_HOST; in mbedtls_net_connect()
184 ret = MBEDTLS_ERR_NET_SOCKET_FAILED; in mbedtls_net_connect()
189 ret = 0; in mbedtls_net_connect()
194 ret = MBEDTLS_ERR_NET_CONNECT_FAILED; in mbedtls_net_connect()
199 return ret; in mbedtls_net_connect()
207 int n, ret; in mbedtls_net_bind() local
210 if ((ret = net_prepare()) != 0) { in mbedtls_net_bind()
211 return ret; in mbedtls_net_bind()
228 ret = MBEDTLS_ERR_NET_UNKNOWN_HOST; in mbedtls_net_bind()
233 ret = MBEDTLS_ERR_NET_SOCKET_FAILED; in mbedtls_net_bind()
241 ret = MBEDTLS_ERR_NET_SOCKET_FAILED; in mbedtls_net_bind()
247 ret = MBEDTLS_ERR_NET_BIND_FAILED; in mbedtls_net_bind()
255 ret = MBEDTLS_ERR_NET_LISTEN_FAILED; in mbedtls_net_bind()
261 ret = 0; in mbedtls_net_bind()
267 return ret; in mbedtls_net_bind()
321 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_accept() local
345 ret = client_ctx->fd = (int) accept(bind_ctx->fd, in mbedtls_net_accept()
351 ret = (int) recvfrom(bind_ctx->fd, buf, sizeof(buf), MSG_PEEK, in mbedtls_net_accept()
355 if (ret == SOCKET_ERROR && in mbedtls_net_accept()
358 ret = 0; in mbedtls_net_accept()
363 if (ret < 0) { in mbedtls_net_accept()
455 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_poll() local
463 ret = check_fd(fd, 1); in mbedtls_net_poll()
464 if (ret != 0) { in mbedtls_net_poll()
465 return ret; in mbedtls_net_poll()
498 ret = select(fd + 1, &read_fds, &write_fds, NULL, in mbedtls_net_poll()
500 } while (IS_EINTR(ret)); in mbedtls_net_poll()
502 if (ret < 0) { in mbedtls_net_poll()
506 ret = 0; in mbedtls_net_poll()
508 ret |= MBEDTLS_NET_POLL_READ; in mbedtls_net_poll()
511 ret |= MBEDTLS_NET_POLL_WRITE; in mbedtls_net_poll()
514 return ret; in mbedtls_net_poll()
542 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_recv() local
545 ret = check_fd(fd, 0); in mbedtls_net_recv()
546 if (ret != 0) { in mbedtls_net_recv()
547 return ret; in mbedtls_net_recv()
550 ret = (int) read(fd, buf, len); in mbedtls_net_recv()
552 if (ret < 0) { in mbedtls_net_recv()
575 return ret; in mbedtls_net_recv()
584 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_recv_timeout() local
589 ret = check_fd(fd, 1); in mbedtls_net_recv_timeout()
590 if (ret != 0) { in mbedtls_net_recv_timeout()
591 return ret; in mbedtls_net_recv_timeout()
600 ret = select(fd + 1, &read_fds, NULL, NULL, timeout == 0 ? NULL : &tv); in mbedtls_net_recv_timeout()
603 if (ret == 0) { in mbedtls_net_recv_timeout()
607 if (ret < 0) { in mbedtls_net_recv_timeout()
631 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_net_send() local
634 ret = check_fd(fd, 0); in mbedtls_net_send()
635 if (ret != 0) { in mbedtls_net_send()
636 return ret; in mbedtls_net_send()
639 ret = (int) write(fd, buf, len); in mbedtls_net_send()
641 if (ret < 0) { in mbedtls_net_send()
664 return ret; in mbedtls_net_send()