Fix build on ia64.
I found no way how to use CMSG_NXTHDR() macro on ia64 without alignment warnings. MFC after: 1 week
This commit is contained in:
parent
2c450cb873
commit
94486ae22d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218148
@ -113,7 +113,7 @@ proto_common_descriptor_send(int sock, int fd)
|
||||
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, int *fdp)
|
||||
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_FIRSTHDR(&msg);
|
||||
if (cmsg->cmsg_level != SOL_SOCKET ||
|
||||
cmsg->cmsg_type == SCM_RIGHTS) {
|
||||
// *fdp = *((int *)CMSG_DATA(cmsg));
|
||||
return (0);
|
||||
}
|
||||
return (EINVAL);
|
||||
}
|
||||
bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp));
|
||||
|
||||
return (ENOENT);
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user