aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/thread.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-10-30 16:05:43 +0100
committerCorinna Vinschen <corinna@vinschen.de>2015-10-30 16:05:43 +0100
commit8f97c045b8e65784071fd097fc32a1f16b855b3b (patch)
tree396d30de65dba1a54afe97023f37ad1dd8fe1184 /winsup/cygwin/thread.cc
parentff3c4a7d2fd686543140b0d39177c3464d1444e1 (diff)
downloadnewlib-8f97c045b8e65784071fd097fc32a1f16b855b3b.zip
newlib-8f97c045b8e65784071fd097fc32a1f16b855b3b.tar.gz
newlib-8f97c045b8e65784071fd097fc32a1f16b855b3b.tar.bz2
Fix sigwait and pthread_kill return values in case of error
* signal.cc (sigwait): Fix return value to reflect errno in case of error according to POSIX. Never return EINTR. * thread.cc (pthread_kill): Return errno if sig_send failed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index d9b6211..ff84590 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -3056,7 +3056,11 @@ pthread_kill (pthread_t thread, int sig)
if (!thread->valid)
rval = ESRCH;
else if (sig)
- rval = sig_send (NULL, si, thread->cygtls);
+ {
+ rval = sig_send (NULL, si, thread->cygtls);
+ if (rval == -1)
+ rval = get_errno ();
+ }
else
switch (WaitForSingleObject (thread->win32_obj_id, 0))
{