projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add PTRACE_PEEKSIGINFO to ptrace.h
[musl]
/
src
/
errno
/
__errno_location.c
diff --git
a/src/errno/__errno_location.c
b/src/errno/__errno_location.c
index
0a220b6
..
3e92d7c
100644
(file)
--- a/
src/errno/__errno_location.c
+++ b/
src/errno/__errno_location.c
@@
-1,11
+1,8
@@
-#include <errno.h>
-#include "libc.h"
-
-#undef errno
-int errno;
+#include "pthread_impl.h"
int *__errno_location(void)
{
int *__errno_location(void)
{
- if (libc.errno_location) return libc.errno_location();
- return &errno;
+ static int e;
+ if (libc.main_thread) return __pthread_self()->errno_ptr;
+ return &e;
}
}