summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Dudani <adudani@quicinc.com>2009-10-12 00:53:07 -0700
committerAmar Singhal <c_amars@quicinc.com>2009-10-13 15:07:08 -0700
commit8bcb1a3b9f69df4a0b4350ccc94bed947d7e9fea (patch)
tree65fe2f95847cc1ea3b53a430200966fb997e1ff5
parentdce33c3a81a3e06072c6b5b855ee06d43fc272db (diff)
downloadbionic-M76XXTSNCJNLYA47354016.zip
bionic-M76XXTSNCJNLYA47354016.tar.gz
bionic-M76XXTSNCJNLYA47354016.tar.bz2
While this is not a fix for the CR, this may prevent native crash as seen in CR 212158
-rw-r--r--libc/bionic/pthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index ec3c459..f2d9cb3 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -1538,7 +1538,11 @@ int pthread_kill(pthread_t tid, int sig)
int old_errno = errno;
pthread_internal_t * thread = (pthread_internal_t *)tid;
+ if (!thread)
+ return ESRCH;
+
ret = tkill(thread->kernel_id, sig);
+
if (ret < 0) {
ret = errno;
errno = old_errno;