From: Ronnie Sahlberg Date: Sun, 14 Apr 2013 15:43:59 +0000 (-0700) Subject: SOCKET: Use recv/send for all socket io on all platforms X-Git-Tag: upstream/1.9.6^2~219 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=099be710b67ac221279f7d69c5c902206f69f587;p=deb_libnfs.git SOCKET: Use recv/send for all socket io on all platforms instead of only on windows and aros and read/write on the others --- 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;