fix missing comma in sh setjmp asm
[musl] / src / errno / __errno_location.c
index 0a220b6..49654ef 100644 (file)
@@ -1,11 +1,8 @@
-#include <errno.h>
-#include "libc.h"
-
-#undef errno
-int errno;
+#include "pthread_impl.h"
 
 int *__errno_location(void)
 {
-       if (libc.errno_location) return libc.errno_location();
-       return &errno;
+       static int e;
+       if (libc.has_thread_pointer) return &__pthread_self()->errno_val;
+       return &e;
 }