]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fix for the previous Solaris fix. fd_send() was sending two fds.
authorTimo Sirainen <tss@iki.fi>
Sat, 19 Jun 2004 21:44:01 +0000 (00:44 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 19 Jun 2004 21:44:01 +0000 (00:44 +0300)
--HG--
branch : HEAD

src/lib/fdpass.c

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