Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/ibm-public/postfix/dist/src/util Hack for clang to ...



details:   https://anonhg.NetBSD.org/src/rev/c720b043dbd7
branches:  trunk
changeset: 765564:c720b043dbd7
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon May 30 16:24:13 2011 +0000

description:
Hack for clang to workaround non-ICE CMSG_SPACE used in union.

diffstat:

 external/ibm-public/postfix/dist/src/util/unix_recv_fd.c |  10 +++++++---
 external/ibm-public/postfix/dist/src/util/unix_send_fd.c |   8 ++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 0cdbdf8fd721 -r c720b043dbd7 external/ibm-public/postfix/dist/src/util/unix_recv_fd.c
--- a/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c  Mon May 30 16:20:58 2011 +0000
+++ b/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c  Mon May 30 16:24:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unix_recv_fd.c,v 1.4 2011/03/02 19:56:39 tron Exp $    */
+/*     $NetBSD: unix_recv_fd.c,v 1.5 2011/05/30 16:24:13 joerg Exp $   */
 
 /*++
 /* NAME
@@ -70,7 +70,11 @@
 #if defined(CMSG_SPACE) && !defined(NO_MSGHDR_MSG_CONTROL)
     union {
        struct cmsghdr just_for_alignment;
-       char    control[CMSG_SPACE(sizeof(newfd))];
+#  ifdef __clang__
+       char    control[128];
+#  else
+       char    control[CMSG_SPACE(sizeof(newfd))]
+#  endif
     }       control_un;
     struct cmsghdr *cmptr;
 
@@ -79,7 +83,7 @@
     if (unix_pass_fd_fix & UNIX_PASS_FD_FIX_CMSG_LEN) {
        msg.msg_controllen = CMSG_LEN(sizeof(newfd));   /* Fix 200506 */
     } else {
-       msg.msg_controllen = sizeof(control_un.control);        /* normal */
+       msg.msg_controllen = CMSG_SPACE(sizeof(newfd)); /* normal */
     }
 #else
     msg.msg_accrights = (char *) &newfd;
diff -r 0cdbdf8fd721 -r c720b043dbd7 external/ibm-public/postfix/dist/src/util/unix_send_fd.c
--- a/external/ibm-public/postfix/dist/src/util/unix_send_fd.c  Mon May 30 16:20:58 2011 +0000
+++ b/external/ibm-public/postfix/dist/src/util/unix_send_fd.c  Mon May 30 16:24:13 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unix_send_fd.c,v 1.4 2011/03/02 19:56:39 tron Exp $    */
+/*     $NetBSD: unix_send_fd.c,v 1.5 2011/05/30 16:24:13 joerg Exp $   */
 
 /*++
 /* NAME
@@ -72,7 +72,11 @@
 #if defined(CMSG_SPACE) && !defined(NO_MSGHDR_MSG_CONTROL)
     union {
        struct cmsghdr just_for_alignment;
+#  ifdef __clang__
+       char    control[128];
+#  else
        char    control[CMSG_SPACE(sizeof(sendfd))];
+#  endif
     }       control_un;
     struct cmsghdr *cmptr;
 
@@ -81,7 +85,7 @@
     if (unix_pass_fd_fix & UNIX_PASS_FD_FIX_CMSG_LEN) {
        msg.msg_controllen = CMSG_LEN(sizeof(sendfd));  /* Fix 200506 */
     } else {
-       msg.msg_controllen = sizeof(control_un.control);        /* normal */
+       msg.msg_controllen = CMSG_SPACE(sizeof(sendfd));        /* normal */
     }
     cmptr = CMSG_FIRSTHDR(&msg);
     cmptr->cmsg_len = CMSG_LEN(sizeof(sendfd));



Home | Main Index | Thread Index | Old Index