The Samba-Bugzilla – Attachment 11457 Details for
Bug 11053
source3/lib/msghdr.c compiling error on Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for referance only
file_11053.txt (text/plain), 1.66 KB, created by
Tom Schulz
on 2015-09-23 15:42:09 UTC
(
hide
)
Description:
Patch for referance only
Filename:
MIME Type:
Creator:
Tom Schulz
Created:
2015-09-23 15:42:09 UTC
Size:
1.66 KB
patch
obsolete
>--- a/source3/lib/msghdr.c 2015-03-10 08:28:31.000000000 -0400 >+++ b/source3/lib/msghdr.c 2015-09-18 13:59:52.040243000 -0400 >@@ -21,9 +21,14 @@ > #include "lib/util/iov_buf.h" > #include <sys/socket.h> > >+ #if !defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) && !defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) >+ # error Can not pass file descriptors >+ #endif >+ > ssize_t msghdr_prep_fds(struct msghdr *msg, uint8_t *buf, size_t bufsize, > const int *fds, size_t num_fds) > { >+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL > size_t fds_size = sizeof(int) * MIN(num_fds, INT8_MAX); > size_t cmsg_len = CMSG_LEN(fds_size); > size_t cmsg_space = CMSG_SPACE(fds_size); >@@ -56,6 +61,27 @@ > msg->msg_controllen = cmsg->cmsg_len; > > return cmsg_space; >+#else /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */ >+ >+ if (num_fds == 0) { >+ if (msg != NULL) { >+ msg->msg_accrights = NULL; >+ msg->msg_accrightslen = 0; >+ } >+ return 0; >+ } >+ if (num_fds > INT8_MAX) { >+ return -1; >+ } >+ if ((msg == NULL) || (num_fds > bufsize)) { >+ return num_fds; >+ } >+ >+ msg->msg_accrights = buf; >+ msg->msg_accrightslen = num_fds; >+ >+ return num_fds; >+#endif > } > > struct msghdr_buf { >@@ -139,6 +165,7 @@ > if (bufsize < ret) { > return ret; > } >+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL > if (msg != NULL) { > if (num_fds != 0) { > msg->msg_control = buf; >@@ -148,6 +175,17 @@ > msg->msg_controllen = 0; > } > } >+#else /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */ >+ if (msg != NULL) { >+ if (num_fds != 0) { >+ msg->msg_accrights= buf; >+ msg->msg_accrightslen = ret; >+ } else { >+ msg->msg_accrights = NULL; >+ msg->msg_accrightslen = 0; >+ } >+ } >+#endif > return ret; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11053
:
10623
| 11457 |
11476