[Glibc-bsd-commits] r5795 - trunk/glibc-ports/kfreebsd

aurel32 at alioth.debian.org aurel32 at alioth.debian.org
Tue Oct 20 14:29:56 UTC 2015


Author: aurel32
Date: 2015-10-20 14:29:56 +0000 (Tue, 20 Oct 2015)
New Revision: 5795

Modified:
   trunk/glibc-ports/kfreebsd/if_index.c
Log:
Merge from upstream:

commit 9a44d530c464d081e925b1c1af2b8bbe6e7b3207
Author: Joseph Myers <joseph at codesourcery.com>
Date:   Tue Dec 16 18:18:49 2014 +0000

    Fix resolver if_* namespace (bug 17717).

    Resolver code, brought in by pthreads (at least), uses if_* interfaces
    that weren't in POSIX before 2001, resulting in linknamespace
    failures.  This patch changes those interfaces to be weak aliases of
    __if_* and makes the resolver use __if_* directly.



Modified: trunk/glibc-ports/kfreebsd/if_index.c
===================================================================
--- trunk/glibc-ports/kfreebsd/if_index.c	2015-10-20 13:50:24 UTC (rev 5794)
+++ trunk/glibc-ports/kfreebsd/if_index.c	2015-10-20 14:29:56 UTC (rev 5795)
@@ -130,7 +130,7 @@
 
 /* Return the index of an interface given by name.  */
 unsigned int
-if_nametoindex (const char *ifname)
+__if_nametoindex (const char *ifname)
 {
   struct nametoindex_locals l;
 
@@ -140,7 +140,9 @@
 
   return l.index;
 }
-libc_hidden_def (if_nametoindex)
+libc_hidden_def (__if_nametoindex)
+weak_alias (__if_nametoindex, if_nametoindex)
+libc_hidden_weak (if_nametoindex)
 
 /* ------------------------------------------------------------------------- */
 
@@ -167,7 +169,7 @@
 
 /* Return the name of an interface given by name.  */
 char *
-if_indextoname (unsigned int ifindex, char *ifname)
+__if_indextoname (unsigned int ifindex, char *ifname)
 {
   struct indextoname_locals l;
 
@@ -177,7 +179,8 @@
   if_iterate (indextoname_aux, &l);
   return l.retval;
 }
-libc_hidden_def (if_indextoname)
+weak_alias (__if_indextoname, if_indextoname)
+libc_hidden_weak (if_indextoname)
 
 /* ------------------------------------------------------------------------- */
 
@@ -263,7 +266,7 @@
 /* Return an array of 'struct if_nameindex', one for each present
    interface.  */
 struct if_nameindex *
-if_nameindex (void)
+__if_nameindex (void)
 {
   struct nameindex_locals l;
 
@@ -292,13 +295,14 @@
     }
   return l.s_array;
 }
-libc_hidden_def (if_nameindex)
+weak_alias (__if_nameindex, if_nameindex)
+libc_hidden_weak (if_nameindex)
 
 /* ------------------------------------------------------------------------- */
 
 /* Free an array returned by if_nameindex().  */
 void
-if_freenameindex (struct if_nameindex *ifn)
+__if_freenameindex (struct if_nameindex *ifn)
 {
   if (ifn != NULL)
     {
@@ -308,4 +312,6 @@
       free (ifn);
     }
 }
-libc_hidden_def (if_freenameindex)
+libc_hidden_def (__if_freenameindex)
+weak_alias (__if_freenameindex, if_freenameindex)
+libc_hidden_weak (if_freenameindex)




More information about the Glibc-bsd-commits mailing list