diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-01-28 16:47:42 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-01-28 16:47:42 +0000 |
commit | 5ace9272c7500b71cc5b89d4e9ca5dedb05c03bd (patch) | |
tree | 76c05fa5a3f9cb945bb7d10816ac7566bc0f4d09 | |
parent | dc5a9da956d163529955fb06761571452b712da4 (diff) |
Return ESRCH instead of segfaulting when a thread ID could not be found.
ok marc@, krw@
-rw-r--r-- | lib/libpthread/uthread/uthread_kill.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_kill.c b/lib/libpthread/uthread/uthread_kill.c index 92702e8b870..8b6c6e2456f 100644 --- a/lib/libpthread/uthread/uthread_kill.c +++ b/lib/libpthread/uthread/uthread_kill.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_kill.c,v 1.11 2003/04/30 17:54:17 marc Exp $ */ +/* $OpenBSD: uthread_kill.c,v 1.12 2007/01/28 16:47:41 kettenis Exp $ */ /* PUBLIC_DOMAIN <marc@snafu.org> */ #include <errno.h> @@ -41,7 +41,7 @@ pthread_kill(pthread_t pthread, int sig) if (sig >= 0 && sig < NSIG) { ret = _find_thread(pthread); - if (sig != 0) { + if (ret == 0 && sig != 0) { if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) { _thread_kern_sig_defer(); if (pthread->state == PS_SIGWAIT && |