summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-03-04 21:14:27 +0100
committerStefan Metzmacher <metze@samba.org>2011-03-04 21:19:05 +0100
commit2c7c3d03d5c6b99370f9007aa6fe874d36512be2 (patch)
tree7b19393cadb18e95f30c5365842b9e4c405254b5 /lib
parent9c342c44a46f883bfd633ea48b04a9bcca930ab6 (diff)
downloadsamba-2c7c3d03d5c6b99370f9007aa6fe874d36512be2.tar.gz
samba-2c7c3d03d5c6b99370f9007aa6fe874d36512be2.tar.bz2
samba-2c7c3d03d5c6b99370f9007aa6fe874d36512be2.zip
lib/socket_wrapper: try to fix the build on solaris
struct msg does not contain msg_control, msg_controllen and msg_flags on solaris. metze
Diffstat (limited to 'lib')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 02cce3f4c0..cd913275f6 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -2147,13 +2147,16 @@ _PUBLIC_ ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, con
tmp.iov_base = discard_const_p(char, buf);
tmp.iov_len = len;
+ ZERO_STRUCT(msg);
msg.msg_name = discard_const_p(struct sockaddr, to); /* optional address */
msg.msg_namelen = tolen; /* size of address */
msg.msg_iov = &tmp; /* scatter/gather array */
msg.msg_iovlen = 1; /* # elements in msg_iov */
+#if 0 /* not available on solaris */
msg.msg_control = NULL; /* ancillary data, see below */
msg.msg_controllen = 0; /* ancillary data buffer len */
msg.msg_flags = 0; /* flags on received message */
+#endif
ret = swrap_sendmsg_before(si, &msg, &tmp, &un_addr, &to_un, &to, &bcast);
if (ret == -1) return -1;
@@ -2264,13 +2267,16 @@ _PUBLIC_ ssize_t swrap_send(int s, const void *buf, size_t len, int flags)
tmp.iov_base = discard_const_p(char, buf);
tmp.iov_len = len;
+ ZERO_STRUCT(msg);
msg.msg_name = NULL; /* optional address */
msg.msg_namelen = 0; /* size of address */
msg.msg_iov = &tmp; /* scatter/gather array */
msg.msg_iovlen = 1; /* # elements in msg_iov */
+#if 0 /* not available on solaris */
msg.msg_control = NULL; /* ancillary data, see below */
msg.msg_controllen = 0; /* ancillary data buffer len */
msg.msg_flags = 0; /* flags on received message */
+#endif
ret = swrap_sendmsg_before(si, &msg, &tmp, &un_addr, NULL, NULL, NULL);
if (ret == -1) return -1;
@@ -2303,13 +2309,17 @@ _PUBLIC_ ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags)
tmp.iov_base = NULL;
tmp.iov_len = 0;
+ msg = *omsg;
+#if 0
msg.msg_name = omsg->msg_name; /* optional address */
msg.msg_namelen = omsg->msg_namelen; /* size of address */
msg.msg_iov = omsg->msg_iov; /* scatter/gather array */
msg.msg_iovlen = omsg->msg_iovlen; /* # elements in msg_iov */
+ /* the following is not available on solaris */
msg.msg_control = omsg->msg_control; /* ancillary data, see below */
msg.msg_controllen = omsg->msg_controllen; /* ancillary data buffer len */
msg.msg_flags = omsg->msg_flags; /* flags on received message */
+#endif
ret = swrap_sendmsg_before(si, &msg, &tmp, &un_addr, &to_un, &to, &bcast);
if (ret == -1) return -1;
@@ -2461,13 +2471,16 @@ int swrap_writev(int s, const struct iovec *vector, size_t count)
tmp.iov_base = NULL;
tmp.iov_len = 0;
+ ZERO_STRUCT(msg);
msg.msg_name = NULL; /* optional address */
msg.msg_namelen = 0; /* size of address */
msg.msg_iov = discard_const_p(struct iovec, vector); /* scatter/gather array */
msg.msg_iovlen = count; /* # elements in msg_iov */
+#if 0 /* not available on solaris */
msg.msg_control = NULL; /* ancillary data, see below */
msg.msg_controllen = 0; /* ancillary data buffer len */
msg.msg_flags = 0; /* flags on received message */
+#endif
ret = swrap_sendmsg_before(si, &msg, &tmp, &un_addr, NULL, NULL, NULL);
if (ret == -1) return -1;