X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ferrno%2F__errno_location.c;h=3e92d7c7a89abc6e10c31ff3e600bfa2e987fe28;hb=5afc74fbaa2371f30df0dc9fb7bc3afe6bd96137;hp=a0185780c531cc2a21edf9b0d059eac1b4c6c071;hpb=71e6be641fb1e4080c2bb901e83423546d0ad5af;p=musl 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 -#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; }