Cygwin: raise: align return value and error checking to Linux
raise(2) on Linux returns the same values and sets errno independent of calling kill(2) or pthread_kill(3). Align code to behave the same. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
24bffff63e
commit
afb7c557d2
|
@ -303,7 +303,12 @@ raise (int sig)
|
|||
pthread *thread = _my_tls.tid;
|
||||
if (!thread || !__isthreaded)
|
||||
return kill (myself->pid, sig);
|
||||
return pthread_kill (thread, sig);
|
||||
|
||||
/* Make sure to return -1 and set errno, as on Linux. */
|
||||
int err = pthread_kill (thread, sig);
|
||||
if (err)
|
||||
set_errno (err);
|
||||
return err ? -1 : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue