diff options
author | ngie <ngie@FreeBSD.org> | 2015-04-11 03:13:09 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-04-11 03:13:09 +0000 |
commit | 7f2176680016863a5439eec93ef66384706219b0 (patch) | |
tree | 0a7951712f70e967d72892152ef5014bb924090a /tools | |
parent | ceff40836c71493e83d9f821e915a987135ab154 (diff) | |
download | FreeBSD-src-7f2176680016863a5439eec93ef66384706219b0.zip FreeBSD-src-7f2176680016863a5439eec93ef66384706219b0.tar.gz |
Fix warnings and bump WARNS to 6
- Garbage collect argc/argv (-Wunused)
- sleep(3) will always return an unsigned int; don't check for return codes <0
(-Wsign-compare)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/sockets/sblock/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/sockets/sblock/sblock.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/regression/sockets/sblock/Makefile b/tools/regression/sockets/sblock/Makefile index af8d0e4..aa2f890 100644 --- a/tools/regression/sockets/sblock/Makefile +++ b/tools/regression/sockets/sblock/Makefile @@ -4,6 +4,6 @@ PROG= sblock MAN= -WARNS?= 2 +WARNS?= 6 .include <bsd.prog.mk> diff --git a/tools/regression/sockets/sblock/sblock.c b/tools/regression/sockets/sblock/sblock.c index a9f9518..415c4d4 100644 --- a/tools/regression/sockets/sblock/sblock.c +++ b/tools/regression/sockets/sblock/sblock.c @@ -54,7 +54,7 @@ static int interrupted; static void -signal_handler(int signum) +signal_handler(int signum __unused) { interrupted++; @@ -95,7 +95,7 @@ locking_recver(int fd) ssize_t len; char ch; - if (sleep(1) < 0) + if (sleep(1) != 0) err(-1, "FAIL: locking_recver: sleep"); len = recv(fd, &ch, sizeof(ch), 0); if (len < 0 && errno != EINTR) @@ -116,7 +116,7 @@ signaller(pid_t locking_recver_pid, int fd) ssize_t len; char ch; - if (sleep(2) < 0) { + if (sleep(2) != 0) { warn("signaller sleep(2)"); return; } @@ -124,7 +124,7 @@ signaller(pid_t locking_recver_pid, int fd) warn("signaller kill(%d)", locking_recver_pid); return; } - if (sleep(1) < 0) { + if (sleep(1) != 0) { warn("signaller sleep(1)"); return; } @@ -141,14 +141,14 @@ signaller(pid_t locking_recver_pid, int fd) warn("signaller close"); return; } - if (sleep(1) < 0) { + if (sleep(1) != 0) { warn("signaller sleep(1)"); return; } } int -main(int argc, char *argv[]) +main(void) { int error, fds[2], recver_fd, sender_fd; pid_t blocking_recver_pid; |