X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=3d9395cb7e0a0b5797c962e4af2d22d95de93718;hb=4fd0f2056082441a4503f6bfcb787a7c15754518;hp=0a139231caae5afad1ae11b54f659fd64fecb07f;hpb=4df42163511182bfd6fc55e85250b93786dcce7e;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 0a139231..3d9395cb 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -1,11 +1,12 @@ #include "pthread_impl.h" +#include "lock.h" int pthread_kill(pthread_t t, int sig) { int r; LOCK(t->killlock); - r = t->dead ? (sig+0U >= _NSIG ? EINVAL : 0) - : -__syscall(SYS_tkill, t->tid, sig); + r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) + : (sig+0U >= _NSIG ? EINVAL : 0); UNLOCK(t->killlock); return r; }