diff options
author | ngie <ngie@FreeBSD.org> | 2015-04-10 07:35:53 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-04-10 07:35:53 +0000 |
commit | 0591d7c2f2291e556b8844dc46eb00455e86e58f (patch) | |
tree | 795a2c9b81bc296f51e26838b6e2949b98e2ea3d /tools | |
parent | 662cdec1647deb55c7efa330f1f95d67995ec433 (diff) | |
download | FreeBSD-src-0591d7c2f2291e556b8844dc46eb00455e86e58f.zip FreeBSD-src-0591d7c2f2291e556b8844dc46eb00455e86e58f.tar.gz |
Fix warnings, fix a typo in a testcase description, bump WARNS to 3
- Remove argc/argv (-Wunused)
- Cast len in comparison to size_t (-Wsign-compare)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/sockets/unix_passfd/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/sockets/unix_passfd/unix_passfd.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/regression/sockets/unix_passfd/Makefile b/tools/regression/sockets/unix_passfd/Makefile index 77c6b03..600b7b1 100644 --- a/tools/regression/sockets/unix_passfd/Makefile +++ b/tools/regression/sockets/unix_passfd/Makefile @@ -2,6 +2,6 @@ PROG= unix_passfd MAN= -WARNS?= 2 +WARNS?= 3 .include <bsd.prog.mk> diff --git a/tools/regression/sockets/unix_passfd/unix_passfd.c b/tools/regression/sockets/unix_passfd/unix_passfd.c index cc0acaa..07ef589 100644 --- a/tools/regression/sockets/unix_passfd/unix_passfd.c +++ b/tools/regression/sockets/unix_passfd/unix_passfd.c @@ -139,7 +139,7 @@ sendfd_payload(const char *test, int sockfd, int sendfd, len = sendmsg(sockfd, &msghdr, 0); if (len < 0) err(-1, "%s: sendmsg", test); - if (len != paylen) + if ((size_t)len != paylen) errx(-1, "%s: sendmsg: %zd bytes sent", test, len); } @@ -175,7 +175,7 @@ recvfd_payload(const char *test, int sockfd, int *recvfd, len = recvmsg(sockfd, &msghdr, 0); if (len < 0) err(-1, "%s: recvmsg", test); - if (len != buflen) + if ((size_t)len != buflen) errx(-1, "%s: recvmsg: %zd bytes received", test, len); cmsghdr = CMSG_FIRSTHDR(&msghdr); @@ -205,7 +205,7 @@ recvfd(const char *test, int sockfd, int *recvfd) } int -main(int argc, char *argv[]) +main(void) { struct stat putfd_1_stat, putfd_2_stat, getfd_1_stat, getfd_2_stat; int fd[2], putfd_1, putfd_2, getfd_1, getfd_2; @@ -354,7 +354,7 @@ main(int argc, char *argv[]) * payload. Payload + SCM_RIGHTS + LOCAL_CREDS hit socket buffer * limit, and receiver receives truncated data. */ - test = "test8-rigths+creds+payload"; + test = "test8-rights+creds+payload"; printf("beginning %s\n", test); { |