svn commit: r210085 - stable/8/sys/kern

John Baldwin jhb at FreeBSD.org
Wed Jul 14 21:52:03 UTC 2010


Author: jhb
Date: Wed Jul 14 21:52:02 2010
New Revision: 210085
URL: http://svn.freebsd.org/changeset/base/210085

Log:
  MFC 209595:
  Send SIGPIPE to the thread that issued the offending system call
  rather than to the entire process.

Modified:
  stable/8/sys/kern/sys_generic.c
  stable/8/sys/kern/sys_socket.c
  stable/8/sys/kern/uipc_syscalls.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/sys_generic.c
==============================================================================
--- stable/8/sys/kern/sys_generic.c	Wed Jul 14 21:48:16 2010	(r210084)
+++ stable/8/sys/kern/sys_generic.c	Wed Jul 14 21:52:02 2010	(r210085)
@@ -532,7 +532,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);
+			tdksignal(td, SIGPIPE, NULL);
 			PROC_UNLOCK(td->td_proc);
 		}
 	}

Modified: stable/8/sys/kern/sys_socket.c
==============================================================================
--- stable/8/sys/kern/sys_socket.c	Wed Jul 14 21:48:16 2010	(r210084)
+++ stable/8/sys/kern/sys_socket.c	Wed Jul 14 21:52:02 2010	(r210085)
@@ -102,7 +102,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);
+		tdksignal(uio->uio_td, SIGPIPE, NULL);
 		PROC_UNLOCK(uio->uio_td->td_proc);
 	}
 	return (error);

Modified: stable/8/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/8/sys/kern/uipc_syscalls.c	Wed Jul 14 21:48:16 2010	(r210084)
+++ stable/8/sys/kern/uipc_syscalls.c	Wed Jul 14 21:52:02 2010	(r210085)
@@ -794,7 +794,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);
+			tdksignal(td, SIGPIPE, NULL);
 			PROC_UNLOCK(td->td_proc);
 		}
 	}
@@ -2448,7 +2448,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);
+			tdksignal(td, SIGPIPE, NULL);
 			PROC_UNLOCK(td->td_proc);
 		}
 	}
@@ -2566,7 +2566,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);
+			tdksignal(td, SIGPIPE, NULL);
 			PROC_UNLOCK(td->td_proc);
 		}
 	}


More information about the svn-src-all mailing list