diff options
author | ngie <ngie@FreeBSD.org> | 2015-04-11 03:38:49 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-04-11 03:38:49 +0000 |
commit | 1add384e4dd97e57ad8135216729c7d3407c51b6 (patch) | |
tree | c61874172915bdaab750c6f92070e15ac15b0434 /tools | |
parent | 93d332ff6fd53ee0ad0870694dbe912c9c89fb40 (diff) | |
download | FreeBSD-src-1add384e4dd97e57ad8135216729c7d3407c51b6.zip FreeBSD-src-1add384e4dd97e57ad8135216729c7d3407c51b6.tar.gz |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/sockets/unix_bindconnect/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/sockets/unix_bindconnect/unix_bindconnect.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/regression/sockets/unix_bindconnect/Makefile b/tools/regression/sockets/unix_bindconnect/Makefile index 2c4edfd..52cc844 100644 --- a/tools/regression/sockets/unix_bindconnect/Makefile +++ b/tools/regression/sockets/unix_bindconnect/Makefile @@ -2,6 +2,6 @@ PROG= unix_bindconnect MAN= -WARNS?= 2 +WARNS?= 6 .include <bsd.prog.mk> diff --git a/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c b/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c index 7db82a0..079dc4d 100644 --- a/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c +++ b/tools/regression/sockets/unix_bindconnect/unix_bindconnect.c @@ -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; |