]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Solaris fix by Tim Hurman
authorTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2004 23:42:23 +0000 (02:42 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2004 23:42:23 +0000 (02:42 +0300)
--HG--
branch : HEAD

src/lib/fdpass.c

index d674f006394fde2ece32096a4b568d3a13fe6fb7..a4efc0d8df262079c8e76c56479668f0921d89c0 100644 (file)
 #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