Fix some nits in the unix_passfd tests.

- Remove return statements in functions with a void return type.
- Allocate enough space for the SCM_CREDS and SCM_RIGHTS messages
  received in the rights_creds_payload test.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2018-08-01 19:45:04 +00:00
parent 800ab3e3c7
commit 48729f75e1

View File

@ -165,14 +165,15 @@ sendfd(int sockfd, int send_fd)
{
char ch = 0;
return (sendfd_payload(sockfd, send_fd, &ch, sizeof(ch)));
sendfd_payload(sockfd, send_fd, &ch, sizeof(ch));
}
static void
recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen)
{
struct cmsghdr *cmsghdr;
char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + sizeof(int)];
char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) +
CMSG_SPACE(sizeof(int))];
struct msghdr msghdr;
struct iovec iovec;
ssize_t len;
@ -214,7 +215,7 @@ recvfd(int sockfd, int *recv_fd)
{
char ch = 0;
return (recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch)));
recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch));
}
/*