summary refs log tree commit diff
path: root/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-07 01:55:54 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-07 01:57:26 +0200
commitfab94894d5c5b25d24010f823515fb53822d6623 (patch)
tree9b89ed6b906c902a4f4f33089e18deb41628a442 /hurd
parent785ec62dbd37b0b236c9a7fcc0ac71a2aeb472de (diff)
downloadglibc-fab94894d5c5b25d24010f823515fb53822d6623.tar.gz
glibc-fab94894d5c5b25d24010f823515fb53822d6623.tar.xz
glibc-fab94894d5c5b25d24010f823515fb53822d6623.zip
hurd: Fix hang in _hurd_raise_signal from pthread_kill
When ss is not NULL, it is assumed to be locked.

* hurd/hurd-raise.c (_hurd_raise_signal): Unlock before returning an
error if ss is not NULL.
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurd-raise.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hurd/hurd-raise.c b/hurd/hurd-raise.c
index af464377b6..865e498bf9 100644
--- a/hurd/hurd-raise.c
+++ b/hurd/hurd-raise.c
@@ -29,7 +29,11 @@ _hurd_raise_signal (struct hurd_sigstate *ss,
 		    int signo, const struct hurd_signal_detail *detail)
 {
   if (signo <= 0 || signo >= NSIG)
-    return EINVAL;
+    {
+      if (ss)
+	__spin_unlock (&ss->lock);
+      return EINVAL;
+    }
 
   if (ss == NULL)
     {