1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281395
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 "