about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-08-25 18:30:13 +0000
committerUlrich Drepper <drepper@redhat.com>1999-08-25 18:30:13 +0000
commitcf752fe284e3b67e3258ea205669868e2cab340e (patch)
tree6111b9b2057a92f046628422311e13197e4a45bc /sysdeps
parent2a947279decefbde636886be3ff54333e0c8f4dd (diff)
downloadglibc-cf752fe284e3b67e3258ea205669868e2cab340e.tar.gz
glibc-cf752fe284e3b67e3258ea205669868e2cab340e.tar.xz
glibc-cf752fe284e3b67e3258ea205669868e2cab340e.zip
Update.
1999-08-25  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/if_index.c (if_nameindex): Move
	old_siocfifconf definition to toplevel.
	(__protocol_available): Remove old_siocfifconf definition.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/if_index.c2
-rw-r--r--sysdeps/unix/sysv/linux/if_index.c21
2 files changed, 10 insertions, 13 deletions
diff --git a/sysdeps/generic/if_index.c b/sysdeps/generic/if_index.c
index 7aedf270eb..c9fedac6e7 100644
--- a/sysdeps/generic/if_index.c
+++ b/sysdeps/generic/if_index.c
@@ -55,7 +55,7 @@ stub_warning (if_nameindex)
 
 void
 internal_function
-__protocol_avaliable (int *have_inet, have_inet6)
+__protocol_available (int *have_inet, have_inet6)
 {
   /* By default we assume that IPv4 is avaialble, IPv6 not.  */
   *have_inet = 1;
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index d2951c6fe1..58fb1648f2 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -28,6 +28,13 @@
 
 #include "kernel-features.h"
 
+/* Variable to signal whether SIOCGIFCONF is not available.  */
+#if __ASSUME_SIOCGIFNAME == 0
+static int old_siocgifconf;
+#else
+# define old_siocgifconf 0
+#endif
+
 /* Try to get a socket to talk to the kernel.  */
 #if defined SIOCGIFINDEX || defined SIOCGIFNAME
 static int
@@ -122,11 +129,6 @@ if_nameindex (void)
   unsigned int nifs, i;
   int rq_len;
   struct if_nameindex *idx = NULL;
-# if __ASSUME_SIOCGIFNAME == 0
-  static int old_siocgifconf;
-# else
-#  define old_siocgifconf 0
-# endif
 # define RQ_IFS	4
 
   if (fd < 0)
@@ -281,24 +283,19 @@ if_indextoname (unsigned int ifindex, char *ifname)
 
 void
 internal_function
-__protocol_avaliable (int *have_inet, int *have_inet6)
+__protocol_available (int *have_inet, int *have_inet6)
 {
   int fd = opensock ();
   unsigned int nifs;
   int rq_len;
   struct ifconf ifc;
-# if __ASSUME_SIOCGIFNAME == 0
-  static int old_siocgifconf;
-# else
-#  define old_siocgifconf 0
-# endif
 # define RQ_IFS	4
 
   /* Wirst case assumption.  */
   *have_inet = 0;
   *have_inet6 = 0;
 
-  if (fd == NULL)
+  if (fd < 0)
     /* We cannot open the socket.  No networking at all?  */
     return;