[dovecot-cvs] dovecot/src/lib fdpass.c,1.30,1.31

cras at procontrol.fi cras at procontrol.fi
Tue Jun 29 15:10:39 EEST 2004


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

Modified Files:
	fdpass.c 
Log Message:
added comment about solaris and changed the macros once again, although may
be useless change..



Index: fdpass.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/fdpass.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- fdpass.c	19 Jun 2004 21:44:01 -0000	1.30
+++ fdpass.c	29 Jun 2004 12:10:36 -0000	1.31
@@ -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 <sys/un.h>
 #include <sys/uio.h>
 
+/* 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



More information about the dovecot-cvs mailing list