Fix a -Wuninitialized warning by setting the socket to -1 and bump WARNS to 6

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2015-04-11 03:19:48 +00:00
parent b74bcac4bd
commit bcd1483d9d
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,6 @@
PROG= shutdown
MAN=
WARNS?= 2
WARNS?= 6
.include <bsd.prog.mk>

View File

@ -45,6 +45,8 @@ main(void)
int listen_sock, connect_sock;
u_short port;
listen_sock = -1;
/* Shutdown(2) on an invalid file descriptor has to return EBADF. */
if ((shutdown(listen_sock, SHUT_RDWR) != -1) && (errno != EBADF))
errx(-1, "shutdown() for invalid file descriptor does not "