svn commit: r285910 - in head: lib/libc/sys sys/kern sys/sys

Alexander Kabaev kabaev at gmail.com
Sat Aug 8 19:05:47 UTC 2015


On Mon, 27 Jul 2015 13:17:58 +0000 (UTC)
Ed Schouten <ed at FreeBSD.org> wrote:

> Author: ed
> Date: Mon Jul 27 13:17:57 2015
> New Revision: 285910
> URL: https://svnweb.freebsd.org/changeset/base/285910
> 
> Log:
>   Make shutdown() return ENOTCONN as required by POSIX, part deux.
>   
>   Summary:
>   Back in 2005, maxim@ attempted to fix shutdown() to return ENOTCONN
> in case the socket was not connected (r150152). This had to be rolled
> back (r150155), as it broke some of the existing programs that depend
> on this behavior. I reapplied this change on my system and indeed,
> syslogd failed to start up. I fixed this back in February (279016)
> and MFC'ed it to the supported stable branches. Apart from that,
> things seem to work out all right. Since at least Linux and Mac OS X
> do the right thing, I'd like to go ahead and give this another try.
> To keep old copies of syslogd working, only start returning ENOTCONN
> for recent binaries. I took a look at the XNU sources and they seem
> to test against both SS_ISCONNECTED, SS_ISCONNECTING and
> SS_ISDISCONNECTING, instead of just SS_ISCONNECTED. That seams
> reasonable, so let's do the same. Test Plan: This issue was uncovered
> while writing tests for shutdown() in CloudABI:
> https://github.com/NuxiNL/cloudlibc/blob/master/src/libc/sys/socket/shutdown_test.c#L26
> Reviewers: glebius, rwatson, #manpages, gnn, #network Reviewed By:
> gnn, #network Subscribers: bms, mjg, imp 
>   Differential Revision: https://reviews.freebsd.org/D3039
> 

Hi Ed,

this commit broke more than just syslogd. rtsol and rtsold both are
victims of the change as they are trying to shutdown unconnected
raw sockets to make then 'send-only' and fail.

-- 
Alexander Kabaev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20150808/81b03ca3/attachment.bin>


More information about the svn-src-all mailing list