arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh677316-h_errno.patch

147e83
Partial backport of this upstream commit:
147e83
147e83
commit 9acacaa02f3b75fddc07a56f3d848df45281a5de
147e83
Author: Joseph Myers <joseph@codesourcery.com>
147e83
Date:   Fri Jun 12 10:10:18 2015 +0000
147e83
147e83
    Fix h_errno namespace (bug 18520).
147e83
147e83
The linknamespace test changes in conform/Makefile are not included here
147e83
because glibc 2.17 did not have these tests.
147e83
147e83
diff --git a/include/netdb.h b/include/netdb.h
147e83
index b6d7b90bbf8abd2e..6a6dca9ef57aaa37 100644
147e83
--- a/include/netdb.h
147e83
+++ b/include/netdb.h
147e83
@@ -8,7 +8,7 @@
147e83
 #  if IS_IN (libc)
147e83
 #   define h_errno __libc_h_errno
147e83
 #  else
147e83
-#   define h_errno h_errno	/* For #ifndef h_errno tests.  */
147e83
+#   define h_errno __h_errno
147e83
 #  endif
147e83
 extern __thread int h_errno attribute_tls_model_ie;
147e83
 # endif /* IS_IN_LIB */
147e83
diff --git a/inet/herrno.c b/inet/herrno.c
147e83
index 1802d0e00563839a..0cd84445190728b3 100644
147e83
--- a/inet/herrno.c
147e83
+++ b/inet/herrno.c
147e83
@@ -24,7 +24,7 @@
147e83
 /* We need to have the error status variable of the resolver
147e83
    accessible in the libc.  */
147e83
 
147e83
-__thread int h_errno;
147e83
-extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno")))
147e83
+__thread int __h_errno;
147e83
+extern __thread int __libc_h_errno __attribute__ ((alias ("__h_errno")))
147e83
   attribute_hidden;
147e83
 #define h_errno __libc_h_errno
147e83
diff --git a/nptl/herrno.c b/nptl/herrno.c
147e83
index c0488e4f6754873f..5056e3df88211123 100644
147e83
--- a/nptl/herrno.c
147e83
+++ b/nptl/herrno.c
147e83
@@ -23,12 +23,12 @@
147e83
 
147e83
 /* We need to have the error status variable of the resolver
147e83
    accessible in the libc.  */
147e83
-extern __thread int h_errno;
147e83
+extern __thread int __h_errno;
147e83
 
147e83
 
147e83
 /* When threaded, h_errno may be a per-thread variable.  */
147e83
 int *
147e83
 __h_errno_location (void)
147e83
 {
147e83
-  return &h_errno;
147e83
+  return &__h_errno;
147e83
 }
147e83
diff --git a/resolv/Versions b/resolv/Versions
147e83
index 93faf1e2f5faac79..152ef3f68f9a8b48 100644
147e83
--- a/resolv/Versions
147e83
+++ b/resolv/Versions
147e83
@@ -26,7 +26,7 @@ libc {
147e83
   GLIBC_PRIVATE {
147e83
     __gai_sigqueue;
147e83
 
147e83
-    h_errno; __resp;
147e83
+    __h_errno; __resp;
147e83
 
147e83
     __res_maybe_init; __res_iclose;
147e83
   }