o Return ENOTCONN when shutdown(2) on non-connected socket.

PR:		kern/84761
Submitted by:	James Juran
R-test:		tools/regression/sockets/shutdown
MFC after:	1 month
This commit is contained in:
Maxim Konovalov 2005-09-15 11:45:36 +00:00
parent 214c8ff0e4
commit c5cff17017
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150152

View File

@ -1424,6 +1424,8 @@ soshutdown(so, how)
if (!(how == SHUT_RD || how == SHUT_WR || how == SHUT_RDWR))
return (EINVAL);
if ((so->so_state & SS_ISCONNECTED) == 0)
return (ENOTCONN);
if (how != SHUT_WR)
sorflush(so);