cvs commit: src/sys/kern sys_generic.c
John Baldwin
jhb at freebsd.org
Thu Mar 1 19:44:16 UTC 2007
On Thursday 01 March 2007 14:20, Bruce M Simpson wrote:
> bms 2007-03-01 19:20:25 UTC
>
> FreeBSD src repository
>
> Modified files:
> sys/kern sys_generic.c
> Log:
> Do not dispatch SIGPIPE from the generic write path for a socket; with
> this patch the code behaves according to the comment on the line above.
>
> Without this patch, a socket could cause SIGPIPE to be delivered to its
> process, once with SO_NOSIGPIPE set, and twice without.
>
> With this patch, the kernel now passes the sigpipe regression test.
>
> Tested by: Anton Yuzhaninov
> MFC after: 1 week
Pointy hat to: jhb
This crept in when I merged dofilewrite() with kern_writev() when pwritev()
was added. Prior to pwritev(), write() and pwrite() would DTRT, but writev()
also had the double-signal problem. Looks like the original bug is that when
SO_NOSIGPIPE was added, only dofilewrite() was updated, but not writev().
So, 4.x is fine, writev() is busted from 5.0 on, and write(), pwrite(), and
pwritev() are busted from 6.0 on.
--
John Baldwin
More information about the cvs-src
mailing list