X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ferrno%2F__errno_location.c;h=7f9d6027a276a0b5574362f0e9aa547fed213523;hb=ff5b8ad386d900e4a4c11ecdfb52dceadd9d0ee9;hp=3e92d7c7a89abc6e10c31ff3e600bfa2e987fe28;hpb=357876052b125dcd74882f61afec19d8f519074c;p=musl diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c index 3e92d7c7..7f9d6027 100644 --- a/src/errno/__errno_location.c +++ b/src/errno/__errno_location.c @@ -1,8 +1,9 @@ +#include #include "pthread_impl.h" int *__errno_location(void) { - static int e; - if (libc.main_thread) return __pthread_self()->errno_ptr; - return &e; + return &__pthread_self()->errno_val; } + +weak_alias(__errno_location, ___errno_location);