Date: Wed, 14 Jul 2010 21:52:23 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r210086 - stable/7/sys/kern Message-ID: <201007142152.o6ELqN6k090753@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Jul 14 21:52:23 2010 New Revision: 210086 URL: http://svn.freebsd.org/changeset/base/210086 Log: MFC 209595: Send SIGPIPE to the thread that issued the offending system call rather than to the entire process. Modified: stable/7/sys/kern/sys_generic.c stable/7/sys/kern/sys_socket.c stable/7/sys/kern/uipc_syscalls.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sys_generic.c ============================================================================== --- stable/7/sys/kern/sys_generic.c Wed Jul 14 21:52:02 2010 (r210085) +++ stable/7/sys/kern/sys_generic.c Wed Jul 14 21:52:23 2010 (r210086) @@ -488,7 +488,7 @@ dofilewrite(td, fd, fp, auio, offset, fl /* Socket layer is responsible for issuing SIGPIPE. */ if (fp->f_type != DTYPE_SOCKET && error == EPIPE) { PROC_LOCK(td->td_proc); - psignal(td->td_proc, SIGPIPE); + tdsignal(td->td_proc, td, SIGPIPE, NULL); PROC_UNLOCK(td->td_proc); } } Modified: stable/7/sys/kern/sys_socket.c ============================================================================== --- stable/7/sys/kern/sys_socket.c Wed Jul 14 21:52:02 2010 (r210085) +++ stable/7/sys/kern/sys_socket.c Wed Jul 14 21:52:23 2010 (r210086) @@ -103,7 +103,7 @@ soo_write(struct file *fp, struct uio *u error = sosend(so, 0, uio, 0, 0, 0, uio->uio_td); if (error == EPIPE && (so->so_options & SO_NOSIGPIPE) == 0) { PROC_LOCK(uio->uio_td->td_proc); - psignal(uio->uio_td->td_proc, SIGPIPE); + tdsignal(uio->uio_td->td_proc, uio->uio_td, SIGPIPE, NULL); PROC_UNLOCK(uio->uio_td->td_proc); } return (error); Modified: stable/7/sys/kern/uipc_syscalls.c ============================================================================== --- stable/7/sys/kern/uipc_syscalls.c Wed Jul 14 21:52:02 2010 (r210085) +++ stable/7/sys/kern/uipc_syscalls.c Wed Jul 14 21:52:23 2010 (r210086) @@ -811,7 +811,7 @@ kern_sendit(td, s, mp, flags, control, s if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && !(flags & MSG_NOSIGNAL)) { PROC_LOCK(td->td_proc); - psignal(td->td_proc, SIGPIPE); + tdsignal(td->td_proc, td, SIGPIPE, NULL); PROC_UNLOCK(td->td_proc); } } @@ -2417,7 +2417,7 @@ sctp_generic_sendmsg (td, uap) if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && !(uap->flags & MSG_NOSIGNAL)) { PROC_LOCK(td->td_proc); - psignal(td->td_proc, SIGPIPE); + tdsignal(td->td_proc, td, SIGPIPE, NULL); PROC_UNLOCK(td->td_proc); } } @@ -2528,7 +2528,7 @@ sctp_generic_sendmsg_iov(td, uap) if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) && !(uap->flags & MSG_NOSIGNAL)) { PROC_LOCK(td->td_proc); - psignal(td->td_proc, SIGPIPE); + tdsignal(td->td_proc, td, SIGPIPE, NULL); PROC_UNLOCK(td->td_proc); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007142152.o6ELqN6k090753>