]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-top-half/musl/src/network/h_errno.c
Update to musl 1.2.2.
[wasi-libc.git] / libc-top-half / musl / src / network / h_errno.c
index 4f700ceaf1674d58ed57b1e1de94a3f6d88b4ce7..638f77180314a625e90507a7890cfafa94e7f1b6 100644 (file)
@@ -1,9 +1,11 @@
 #include <netdb.h>
+#include "pthread_impl.h"
 
 #undef h_errno
 int h_errno;
 
 int *__h_errno_location(void)
 {
-       return &h_errno;
+       if (!__pthread_self()->stack) return &h_errno;
+       return &__pthread_self()->h_errno_val;
 }