From owner-svn-src-all@FreeBSD.ORG Mon Jan 31 23:46:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E8E1106566C; Mon, 31 Jan 2011 23:46:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EDCE8FC1D; Mon, 31 Jan 2011 23:46:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0VNkapP049919; Mon, 31 Jan 2011 23:46:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0VNkaFQ049917; Mon, 31 Jan 2011 23:46:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101312346.p0VNkaFQ049917@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 31 Jan 2011 23:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218148 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2011 23:46:36 -0000 Author: pjd Date: Mon Jan 31 23:46:36 2011 New Revision: 218148 URL: http://svn.freebsd.org/changeset/base/218148 Log: Fix build on ia64. I found no way how to use CMSG_NXTHDR() macro on ia64 without alignment warnings. MFC after: 1 week Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Mon Jan 31 23:08:26 2011 (r218147) +++ head/sbin/hastd/proto_common.c Mon Jan 31 23:46:36 2011 (r218148) @@ -113,7 +113,7 @@ proto_common_descriptor_send(int sock, i cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); -// *((int *)CMSG_DATA(cmsg)) = fd; + bcopy(&fd, CMSG_DATA(cmsg), sizeof(fd)); if (sendmsg(sock, &msg, 0) == -1) return (errno); @@ -142,14 +142,12 @@ proto_common_descriptor_recv(int sock, i if (recvmsg(sock, &msg, 0) == -1) return (errno); - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_RIGHTS) { -// *fdp = *((int *)CMSG_DATA(cmsg)); - return (0); - } + cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg->cmsg_level != SOL_SOCKET || + cmsg->cmsg_type == SCM_RIGHTS) { + return (EINVAL); } + bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp)); - return (ENOENT); + return (0); }