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:
parent
b74bcac4bd
commit
bcd1483d9d
@ -4,6 +4,6 @@
|
||||
|
||||
PROG= shutdown
|
||||
MAN=
|
||||
WARNS?= 2
|
||||
WARNS?= 6
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user