From: Timo Sirainen Date: Tue, 29 Jun 2004 12:10:36 +0000 (+0300) Subject: added comment about solaris and changed the macros once again, although may X-Git-Tag: 1.1.alpha1~3853 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=300621f765cdee3e05664169b67aedba9982fe60;p=thirdparty%2Fdovecot%2Fcore.git added comment about solaris and changed the macros once again, although may be useless change.. --HG-- branch : HEAD --- diff --git a/src/lib/fdpass.c b/src/lib/fdpass.c index b89669ca4d..cf1064e9f1 100644 --- a/src/lib/fdpass.c +++ b/src/lib/fdpass.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002-2003 Timo Sirainen */ +/* Copyright (c) 2002-2004 Timo Sirainen */ /* fdpass.c - File descriptor passing between processes via UNIX sockets @@ -30,10 +30,15 @@ #include #include +/* Solaris uses 32bit socklen_t as cmsg_len, so with Solaris we use + _CMSG_DATA_ALIGN() macro to do the alignment for us. + + Perhaps the best solution would be to change sizeof(size_t) calculations + to sizeof(cmsg->cmsg_len)? At least if other OSes have similiar problems.. */ #ifndef CMSG_SPACE # if defined(_CMSG_DATA_ALIGN) && defined(_CMSG_HDR_ALIGN) /* for Solaris */ # define CMSG_SPACE(len) \ - (_CMSG_DATA_ALIGN(len) + _CMSG_HDR_ALIGN(sizeof(struct cmsghdr))) + (_CMSG_DATA_ALIGN(len) + _CMSG_DATA_ALIGN(sizeof(struct cmsghdr))) # define CMSG_LEN(len) \ (_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + (len)) # else