POSIX requires that raise(3) is equivalent to
pthread_kill(pthread_self(), sig);
in multi-threaded applications. Our raise just called kill(sig).
Fix that.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
- Disallow seteuid on disabled or locked out accounts.
Addresses: https://cygwin.com/ml/cygwin/2019-01/msg00197.html
+
+- Fix raise to work as required by POSIX.
+ (Partially) addresses: https://cygwin.com/ml/cygwin/2019-01/msg00149.html
extern "C" int
raise (int sig)
{
- return kill (myself->pid, sig);
+ pthread *thread = _my_tls.tid;
+ if (!thread)
+ return kill (myself->pid, sig);
+ return pthread_kill (thread, sig);
}
static int