svn commit: r281399 - head/tools/regression/sockets/unix_bindconnect
Garrett Cooper
ngie at FreeBSD.org
Sat Apr 11 03:38:51 UTC 2015
Author: ngie
Date: Sat Apr 11 03:38:49 2015
New Revision: 281399
URL: https://svnweb.freebsd.org/changeset/base/281399
Log:
Fix warnings and bump WARNS to 6
- Staticize variables as needed
- Garbage collect argc/argv
- Fix -Wsign-compare warnings by casting small sizeof to (int)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Modified:
head/tools/regression/sockets/unix_bindconnect/Makefile
head/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c
Modified: head/tools/regression/sockets/unix_bindconnect/Makefile
==============================================================================
--- head/tools/regression/sockets/unix_bindconnect/Makefile Sat Apr 11 03:35:33 2015 (r281398)
+++ head/tools/regression/sockets/unix_bindconnect/Makefile Sat Apr 11 03:38:49 2015 (r281399)
@@ -2,6 +2,6 @@
PROG= unix_bindconnect
MAN=
-WARNS?= 2
+WARNS?= 6
.include <bsd.prog.mk>
Modified: head/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c
==============================================================================
--- head/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c Sat Apr 11 03:35:33 2015 (r281398)
+++ head/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c Sat Apr 11 03:38:49 2015 (r281399)
@@ -54,8 +54,8 @@
#define UNWIND_MAX 1024
-int unwind_len;
-struct unwind {
+static int unwind_len;
+static struct unwind {
char u_path[PATH_MAX];
} unwind_list[UNWIND_MAX];
@@ -105,7 +105,7 @@ bind_test(const char *directory_path)
sun.sun_len = sizeof(sun);
sun.sun_family = AF_UNIX;
if (snprintf(sun.sun_path, sizeof(sun.sun_path), "%s", socket_path)
- >= sizeof(sun.sun_path)) {
+ >= (int)sizeof(sun.sun_path)) {
warn("bind_test: snprintf(sun.sun_path)");
close(sock1);
return (-1);
@@ -216,7 +216,7 @@ connect_test(const char *directory_path)
sun.sun_len = sizeof(sun);
sun.sun_family = AF_UNIX;
if (snprintf(sun.sun_path, sizeof(sun.sun_path), "%s", socket_path)
- >= sizeof(sun.sun_path)) {
+ >= (int)sizeof(sun.sun_path)) {
warn("connect_test: snprintf(sun.sun_path)");
close(sock1);
return (-1);
@@ -298,7 +298,7 @@ connect_test(const char *directory_path)
return (0);
}
int
-main(int argc, char *argv[])
+main(void)
{
char directory_path[PATH_MAX];
int error;
More information about the svn-src-head
mailing list