From: Timo Sirainen Date: Mon, 14 Jun 2004 23:42:23 +0000 (+0300) Subject: Solaris fix by Tim Hurman X-Git-Tag: 1.1.alpha1~3979 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7f61a644ca10a271e756201144b68b461a05bca;p=thirdparty%2Fdovecot%2Fcore.git Solaris fix by Tim Hurman --HG-- branch : HEAD --- diff --git a/src/lib/fdpass.c b/src/lib/fdpass.c index d674f00639..a4efc0d8df 100644 --- a/src/lib/fdpass.c +++ b/src/lib/fdpass.c @@ -31,12 +31,20 @@ #include #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