Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2018 19:45:04 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337059 - head/tests/sys/kern
Message-ID:  <201808011945.w71Jj48F053453@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Aug  1 19:45:04 2018
New Revision: 337059
URL: https://svnweb.freebsd.org/changeset/base/337059

Log:
  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

Modified:
  head/tests/sys/kern/unix_passfd_test.c

Modified: head/tests/sys/kern/unix_passfd_test.c
==============================================================================
--- head/tests/sys/kern/unix_passfd_test.c	Wed Aug  1 19:25:12 2018	(r337058)
+++ head/tests/sys/kern/unix_passfd_test.c	Wed Aug  1 19:45:04 2018	(r337059)
@@ -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));
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808011945.w71Jj48F053453>