summaryrefslogtreecommitdiffstats
path: root/source3/modules
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-12-31 14:27:03 +0100
committerJeremy Allison <jra@samba.org>2015-01-06 00:33:10 +0100
commit0f6bf3575e587354fcd0dd274fa0d27210cc9ac6 (patch)
treebd4ee0e9478f2523d7e18246837bc896a14be89b /source3/modules
parent4b1e6ae5d393c3ac5e837b64f16bfbcf5267a2e0 (diff)
downloadsamba-0f6bf3575e587354fcd0dd274fa0d27210cc9ac6.tar.gz
samba-0f6bf3575e587354fcd0dd274fa0d27210cc9ac6.tar.xz
samba-0f6bf3575e587354fcd0dd274fa0d27210cc9ac6.zip
smbd: Properly handle EINTR in vfs_aio_fork
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_aio_fork.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index 7d2aff9064..bf29dd1e01 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -170,8 +170,12 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- if ( (n = recvmsg(fd, &msg, 0)) <= 0) {
- return(n);
+ do {
+ n = recvmsg(fd, &msg, 0);
+ } while ((n == -1) && (errno == EINTR));
+
+ if (n <= 0) {
+ return n;
}
{
@@ -203,6 +207,7 @@ static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd)
size_t bufsize = msghdr_prep_fds(NULL, NULL, 0, &sendfd, 1);
uint8_t buf[bufsize];
struct iovec iov;
+ ssize_t sent;
msghdr_prep_fds(&msg, buf, bufsize, &sendfd, 1);
msg.msg_name = NULL;
@@ -213,7 +218,11 @@ static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd)
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
- return (sendmsg(fd, &msg, 0));
+ do {
+ sent = sendmsg(fd, &msg, 0);
+ } while ((sent == -1) && (errno == EINTR));
+
+ return sent;
}
static void aio_child_cleanup(struct tevent_context *event_ctx,