summaryrefslogtreecommitdiff
path: root/src/errno
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-08-06 20:20:23 -0400
committerRich Felker <dalias@aerifal.cx>2011-08-06 20:20:23 -0400
commit357876052b125dcd74882f61afec19d8f519074c (patch)
tree60b44fc4105d9e4a90fadcbde4cf29960a38c2cf /src/errno
parent98acf04fc00cbded6169056f2cd541d31725c091 (diff)
downloadmusl-357876052b125dcd74882f61afec19d8f519074c.tar.gz
simplify multi-threaded errno, eliminate useless function pointer
Diffstat (limited to 'src/errno')
-rw-r--r--src/errno/__errno_location.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c
index a0185780..3e92d7c7 100644
--- a/src/errno/__errno_location.c
+++ b/src/errno/__errno_location.c
@@ -1,9 +1,8 @@
-#include <errno.h>
-#include "libc.h"
+#include "pthread_impl.h"
int *__errno_location(void)
{
static int e;
- if (libc.errno_location) return libc.errno_location();
+ if (libc.main_thread) return __pthread_self()->errno_ptr;
return &e;
}