summaryrefslogtreecommitdiff
path: root/src/network/h_errno.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/h_errno.c')
-rw-r--r--src/network/h_errno.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/h_errno.c b/src/network/h_errno.c
index 4f700cea..638f7718 100644
--- a/src/network/h_errno.c
+++ b/src/network/h_errno.c
@@ -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;
}