Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crypto/compat/posix_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -221,6 +222,8 @@ ssize_t
posix_read(int fd, void *buf, size_t count)
{
ssize_t rc;
if (count > INT_MAX)
count = INT_MAX;
if (is_socket(fd)) {
if ((rc = recv(fd, buf, count, 0)) == SOCKET_ERROR) {
int err = WSAGetLastError();
Expand All @@ -236,6 +239,8 @@ ssize_t
posix_write(int fd, const void *buf, size_t count)
{
ssize_t rc;
if (count > INT_MAX)
count = INT_MAX;
if (is_socket(fd)) {
if ((rc = send(fd, buf, count, 0)) == SOCKET_ERROR) {
rc = wsa_errno(WSAGetLastError());
Expand Down
Loading