1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2003-03-29  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/ifaddrs.c (getifaddrs): Avoid
	netlink_open calls if netlink is known to not be available.
This commit is contained in:
Ulrich Drepper
2003-03-29 09:24:03 +00:00
parent cc4f0dde88
commit ea473bad4c
3 changed files with 18 additions and 4 deletions

View File

@ -43,9 +43,13 @@
#if __ASSUME_NETLINK_SUPPORT == 0
static int no_netlink_support;
#define getifaddrs fallback_getifaddrs
#include "sysdeps/gnu/ifaddrs.c"
#undef getifaddrs
# define getifaddrs fallback_getifaddrs
# include "sysdeps/gnu/ifaddrs.c"
# undef getifaddrs
#else
# define no_netlink_support 0
#endif
@ -292,7 +296,7 @@ getifaddrs (struct ifaddrs **ifap)
if (ifap)
*ifap = NULL;
if (netlink_open (&nh) < 0)
if (! no_netlink_support && netlink_open (&nh) < 0)
{
#if __ASSUME_NETLINK_SUPPORT == 0
no_netlink_support = 1;