From 099be710b67ac221279f7d69c5c902206f69f587 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 14 Apr 2013 08:43:59 -0700 Subject: [PATCH] SOCKET: Use recv/send for all socket io on all platforms instead of only on windows and aros and read/write on the others --- lib/socket.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/socket.c b/lib/socket.c index 9b16b1b..6f62652 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -118,11 +118,7 @@ static int rpc_write_to_socket(struct rpc_context *rpc) total = rpc->outqueue->outdata.size; -#if defined(WIN32) | defined(AROS) count = send(rpc->fd, rpc->outqueue->outdata.data + rpc->outqueue->written, total - rpc->outqueue->written, 0); -#else - count = write(rpc->fd, rpc->outqueue->outdata.data + rpc->outqueue->written, total - rpc->outqueue->written); -#endif if (count == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) { return 0; @@ -202,11 +198,7 @@ static int rpc_read_from_socket(struct rpc_context *rpc) if (rpc->inpos < 4) { size = 4 - rpc->inpos; -#if defined(WIN32) | defined(AROS) count = recv(rpc->fd, rpc->inbuf + rpc->inpos, size, 0); -#else - count = read(rpc->fd, rpc->inbuf + rpc->inpos, size); -#endif if (count == -1) { if (errno == EINTR) { return 0; @@ -242,11 +234,7 @@ static int rpc_read_from_socket(struct rpc_context *rpc) size = rpc->insize - rpc->inpos; } -#if defined(WIN32) | defined(AROS) count = recv(rpc->fd, rpc->inbuf + rpc->inpos, size, 0); -#else - count = read(rpc->fd, rpc->inbuf + rpc->inpos, size); -#endif if (count == -1) { if (errno == EINTR) { return 0; -- 2.34.1