summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/recvfile.c8
-rw-r--r--source3/lib/sendfile.c20
-rw-r--r--source3/lib/system.c20
-rw-r--r--source3/lib/unix_msg/unix_msg.c6
4 files changed, 4 insertions, 50 deletions
diff --git a/source3/lib/recvfile.c b/source3/lib/recvfile.c
index bffe07f75c..273c51f770 100644
--- a/source3/lib/recvfile.c
+++ b/source3/lib/recvfile.c
@@ -84,11 +84,7 @@ static ssize_t default_sys_recvfile(int fromfd,
read_ret = read(fromfd, buffer, toread);
} while (read_ret == -1 && errno == EINTR);
-#if defined(EWOULDBLOCK)
if (read_ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-#else
- if (read_ret == -1 && (errno == EAGAIN)) {
-#endif
/*
* fromfd socket is in non-blocking mode.
* If we already read some and wrote
@@ -209,11 +205,7 @@ ssize_t sys_recvfile(int fromfd,
return default_sys_recvfile(fromfd, tofd,
offset, count);
}
-#if defined(EWOULDBLOCK)
if (errno == EAGAIN || errno == EWOULDBLOCK) {
-#else
- if (errno == EAGAIN) {
-#endif
/*
* fromfd socket is in non-blocking mode.
* If we already read some and wrote
diff --git a/source3/lib/sendfile.c b/source3/lib/sendfile.c
index d5fd5a6ab5..3d457bd6f1 100644
--- a/source3/lib/sendfile.c
+++ b/source3/lib/sendfile.c
@@ -59,11 +59,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset
ssize_t nwritten;
do {
nwritten = sendfile(tofd, fromfd, &offset, total);
-#if defined(EWOULDBLOCK)
} while (nwritten == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (nwritten == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
if (nwritten == -1) {
if (errno == ENOSYS || errno == EINVAL) {
/* Ok - we're in a world of pain here. We just sent
@@ -139,11 +135,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset
xferred = 0;
nwritten = sendfilev(tofd, vec, sfvcnt, &xferred);
-#if defined(EWOULDBLOCK)
if (nwritten == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) {
-#else
- if (nwritten == -1 && (errno == EINTR || errno == EAGAIN)) {
-#endif
if (xferred == 0)
continue; /* Nothing written yet. */
else
@@ -213,11 +205,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset
do {
nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0);
-#if defined(EWOULDBLOCK)
} while (nwritten == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (nwritten == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
if (nwritten == -1)
return -1;
if (nwritten == 0)
@@ -282,11 +270,7 @@ ssize_t sys_sendfile(int tofd, int fromfd,
#else
ret = sendfile(fromfd, tofd, offset, count, &sf_header, &nwritten, 0);
#endif
-#if defined(EWOULDBLOCK)
if (ret == -1 && errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
-#else
- if (ret == -1 && errno != EINTR && errno != EAGAIN) {
-#endif
/* Send failed, we are toast. */
return -1;
}
@@ -364,11 +348,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset
*/
do {
ret = send_file(&tofd, &hdtrl, 0);
-#if defined(EWOULDBLOCK)
} while ((ret == 1) || (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)));
-#else
- } while ((ret == 1) || (ret == -1 && (errno == EINTR || errno == EAGAIN)));
-#endif
if ( ret == -1 )
return -1;
}
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 698de1221c..6478e6f512 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -62,11 +62,8 @@ ssize_t sys_read(int fd, void *buf, size_t count)
do {
ret = read(fd, buf, count);
-#if defined(EWOULDBLOCK)
} while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
+
return ret;
}
@@ -80,11 +77,8 @@ ssize_t sys_write(int fd, const void *buf, size_t count)
do {
ret = write(fd, buf, count);
-#if defined(EWOULDBLOCK)
} while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
+
return ret;
}
@@ -109,11 +103,8 @@ ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt)
do {
ret = writev(fd, iov, iovcnt);
-#if defined(EWOULDBLOCK)
} while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
+
return ret;
}
@@ -159,11 +150,8 @@ ssize_t sys_send(int s, const void *msg, size_t len, int flags)
do {
ret = send(s, msg, len, flags);
-#if defined(EWOULDBLOCK)
} while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
+
return ret;
}
diff --git a/source3/lib/unix_msg/unix_msg.c b/source3/lib/unix_msg/unix_msg.c
index 00438cebfd..982ae46cd0 100644
--- a/source3/lib/unix_msg/unix_msg.c
+++ b/source3/lib/unix_msg/unix_msg.c
@@ -246,9 +246,7 @@ static void unix_dgram_recv_handler(struct poll_watch *w, int fd, short events,
received = recvmsg(fd, &msg, 0);
if (received == -1) {
if ((errno == EAGAIN) ||
-#ifdef EWOULDBLOCK
(errno == EWOULDBLOCK) ||
-#endif
(errno == EINTR) || (errno == ENOMEM)) {
/* Not really an error - just try again. */
return;
@@ -496,11 +494,7 @@ static int unix_dgram_send(struct unix_dgram_ctx *ctx,
if (ret >= 0) {
return 0;
}
-#ifdef EWOULDBLOCK
if ((errno != EWOULDBLOCK) && (errno != EAGAIN) && (errno != EINTR)) {
-#else
- if ((errno != EAGAIN) && (errno != EINTR)) {
-#endif
return errno;
}