Module Name: src
Committed By: joerg
Date: Mon May 30 16:24:13 UTC 2011
Modified Files:
src/external/ibm-public/postfix/dist/src/util: unix_recv_fd.c
unix_send_fd.c
Log Message:
Hack for clang to workaround non-ICE CMSG_SPACE used in union.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c \
src/external/ibm-public/postfix/dist/src/util/unix_send_fd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c
diff -u src/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c:1.4 src/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c:1.5
--- src/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c:1.4 Wed Mar 2 19:56:39 2011
+++ src/external/ibm-public/postfix/dist/src/util/unix_recv_fd.c Mon May 30 16:24:13 2011
@@ -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;
Index: src/external/ibm-public/postfix/dist/src/util/unix_send_fd.c
diff -u src/external/ibm-public/postfix/dist/src/util/unix_send_fd.c:1.4 src/external/ibm-public/postfix/dist/src/util/unix_send_fd.c:1.5
--- src/external/ibm-public/postfix/dist/src/util/unix_send_fd.c:1.4 Wed Mar 2 19:56:39 2011
+++ src/external/ibm-public/postfix/dist/src/util/unix_send_fd.c Mon May 30 16:24:13 2011
@@ -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));