about summary refs log tree commit diff
path: root/src/errno/__errno_location.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/errno/__errno_location.c')
-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;
 }