From: Timo Sirainen Date: Sat, 19 Jun 2004 21:44:01 +0000 (+0300) Subject: Fix for the previous Solaris fix. fd_send() was sending two fds. X-Git-Tag: 1.1.alpha1~3921 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=356ccdc3bff9a2b01d4bfa6a77bf42933196effa;p=thirdparty%2Fdovecot%2Fcore.git Fix for the previous Solaris fix. fd_send() was sending two fds. --HG-- branch : HEAD --- diff --git a/src/lib/fdpass.c b/src/lib/fdpass.c index a4efc0d8df..b89669ca4d 100644 --- a/src/lib/fdpass.c +++ b/src/lib/fdpass.c @@ -32,11 +32,10 @@ #ifndef CMSG_SPACE # 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)) + (_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + (len)) # else # define CMSG_ALIGN(len) \ (((len) + sizeof(size_t) - 1) & ~(sizeof(size_t) - 1)) @@ -69,6 +68,7 @@ ssize_t fd_send(int handle, int send_fd, const void *data, size_t size) if (send_fd != -1) { /* set the control and controllen before CMSG_FIRSTHDR() */ + memset(buf, 0, sizeof(buf)); msg.msg_control = buf; msg.msg_controllen = sizeof(buf);