summaryrefslogtreecommitdiff
path: root/sys/kern/sys_generic.c
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2008-12-16 07:57:29 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2008-12-16 07:57:29 +0000
commit66f602cf3edb31a30ff3fcee9bd3d4b9d4ff57a7 (patch)
tree446062b72d3d878e3dd07d974267043287dbbd8b /sys/kern/sys_generic.c
parent799c9944fa8bbbc14aab0bb61b58d2823678bc31 (diff)
Move the functionality of psignal() to a new function ptsignal()
that takes an additional argument "type" that indicates whether the signal is for the process, just a particular thread, or propagated to a thread because it's not caught or blocked. psignal() becomes a wrapper that does the first of those. So that sys_kill() can tell apart signals for the process and signals for the process's original thread, the tid of the original thread is defined as its pid + THREAD_PID_OFFSET. ok tedu@ art@ andreas@ kurt@ "better early than late" deraadt@
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r--sys/kern/sys_generic.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index bfcf380a001..ac9d89dd38d 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.58 2007/09/07 15:00:20 art Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.59 2008/12/16 07:57:28 guenther Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -337,7 +337,7 @@ dofilewrite(struct proc *p, int fd, struct file *fp, const void *buf,
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE)
- psignal(p, SIGPIPE);
+ ptsignal(p, SIGPIPE, STHREAD);
}
cnt -= auio.uio_resid;
@@ -448,7 +448,7 @@ dofilewritev(struct proc *p, int fd, struct file *fp, const struct iovec *iovp,
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE)
- psignal(p, SIGPIPE);
+ ptsignal(p, SIGPIPE, STHREAD);
}
cnt -= auio.uio_resid;