summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/raise.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-11-10 03:46:11 +0000
committerguenther <guenther@openbsd.org>2012-11-10 03:46:11 +0000
commitcd4713e96d599489d6a9f10cd4559495bacbc959 (patch)
treefdcaf748d18140dc82c984fe308fc82b353b2411 /lib/libc/gen/raise.c
parentRemove now unused files. (diff)
downloadwireguard-openbsd-cd4713e96d599489d6a9f10cd4559495bacbc959.tar.xz
wireguard-openbsd-cd4713e96d599489d6a9f10cd4559495bacbc959.zip
Per POSIX, fix raise() and abort() to send the signal to the current thread.
Should make coredumps from abort() easier to debug too. ok kurt@
Diffstat (limited to 'lib/libc/gen/raise.c')
-rw-r--r--lib/libc/gen/raise.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c
index 3ca6d3dfac6..d80513fc3fc 100644
--- a/lib/libc/gen/raise.c
+++ b/lib/libc/gen/raise.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raise.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */
+/* $OpenBSD: raise.c,v 1.6 2012/11/10 03:46:11 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,8 +31,10 @@
#include <signal.h>
#include <unistd.h>
+int _thread_sys_getthrid(void);
+
int
raise(int s)
{
- return(kill(getpid(), s));
+ return(kill(_thread_sys_getthrid(), s));
}