[dovecot-cvs] dovecot/src/lib fdpass.c,1.28,1.29

cras at procontrol.fi cras at procontrol.fi
Tue Jun 15 02:42:25 EEST 2004


Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv11171

Modified Files:
	fdpass.c 
Log Message:
Solaris fix by Tim Hurman



Index: fdpass.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/fdpass.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- fdpass.c	1 Dec 2003 19:07:34 -0000	1.28
+++ fdpass.c	14 Jun 2004 23:42:23 -0000	1.29
@@ -31,12 +31,20 @@
 #include <sys/uio.h>
 
 #ifndef CMSG_SPACE
-#  define CMSG_ALIGN(len) \
+#  if defined(_CMSG_DATA_ALIGN) && defined(_CMSG_HDR_ALIGN)  /* for Solaris */
+#    define CMSG_ALIGN(len) _CMSG_DATA_ALIGN(len)
+#    define CMSG_SPACE(len) \
+	(_CMSG_DATA_ALIGN(len) + _CMSG_HDR_ALIGN(sizeof(struct cmsghdr)))
+#    define CMSG_LEN(len) \
+	(_CMSG_HDR_ALIGN(sizeof(struct cmsghdr)) + (len))
+#  else
+#    define CMSG_ALIGN(len) \
 	(((len) + sizeof(size_t) - 1) & ~(sizeof(size_t) - 1))
-#  define CMSG_SPACE(len) \
+#    define CMSG_SPACE(len) \
 	(CMSG_ALIGN(len) + CMSG_ALIGN(sizeof(struct cmsghdr)))
-#  define CMSG_LEN(len) \
+#    define CMSG_LEN(len) \
 	(CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#  endif
 #endif
 
 #ifdef SCM_RIGHTS



More information about the dovecot-cvs mailing list