summaryrefslogtreecommitdiffstats
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2014-10-03 09:24:04 -0700
committerAndreas Schneider <asn@cryptomilk.org>2014-10-06 12:33:35 +0200
commit57bcb8055eb3e15c4ce7bcdeeef7efed175ed347 (patch)
tree0c9af8a9fbba25fb9086eeb6504b7937369784c0 /source3/modules
parent7366204845fda07ee4a83a1a63875f643d0a5794 (diff)
downloadsamba-57bcb8055eb3e15c4ce7bcdeeef7efed175ed347.tar.gz
samba-57bcb8055eb3e15c4ce7bcdeeef7efed175ed347.tar.xz
samba-57bcb8055eb3e15c4ce7bcdeeef7efed175ed347.zip
s3: lib, s3: modules: Fix compilation on Solaris.
Based on work from YOUZHONG YANG <youzhong@gmail.com>. Code needs fixing when HAVE_STRUCT_MSGHDR_MSG_CONTROL is not defined. Also Solaris doesn't have msg_flags field (which we set to zero anyway, so if we initialize the entire struct to zero, we never need to refer to it). https://bugzilla.samba.org/show_bug.cgi?id=10849 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 6 12:33:36 CEST 2014 on sn-devel-104
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_aio_fork.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index c1bded98c5..12e6f80257 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -157,6 +157,7 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
#ifndef HAVE_STRUCT_MSGHDR_MSG_CONTROL
int newfd;
+ ZERO_STRUCT(msg);
msg.msg_accrights = (caddr_t) &newfd;
msg.msg_accrightslen = sizeof(int);
#else
@@ -167,13 +168,15 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
} control_un;
struct cmsghdr *cmptr;
+ ZERO_STRUCT(msg);
+ ZERO_STRUCT(control_un);
+
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof(control_un.control);
#endif
msg.msg_name = NULL;
msg.msg_namelen = 0;
- msg.msg_flags = 0;
iov[0].iov_base = (void *)ptr;
iov[0].iov_len = nbytes;