mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-17 13:53:39 +00:00
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
This commit is contained in:
parent
df7babd689
commit
6f7ca813c4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167150
|
@ -489,7 +489,7 @@ dofilewrite(td, fd, fp, auio, offset, flags)
|
|||
error == EINTR || error == EWOULDBLOCK))
|
||||
error = 0;
|
||||
/* Socket layer is responsible for issuing SIGPIPE. */
|
||||
if (error == EPIPE) {
|
||||
if (fp->f_type != DTYPE_SOCKET && error == EPIPE) {
|
||||
PROC_LOCK(td->td_proc);
|
||||
psignal(td->td_proc, SIGPIPE);
|
||||
PROC_UNLOCK(td->td_proc);
|
||||
|
|
Loading…
Reference in a new issue