Cygwin port: if_indextoname() conditional

This commit is contained in:
Gerhard Rieger 2008-09-26 12:30:35 +02:00
parent a6699a96b5
commit ee504a7bad
3 changed files with 7 additions and 3 deletions

View file

@ -107,6 +107,9 @@
/* Define if you have the memrchr function. */
#undef HAVE_MEMRCHR
/* Define if you have the if_indextoname function. */
#undef HAVE_IF_INDEXTONAME
/* Define if you have the sigaction function */
#undef HAVE_SIGACTION

View file

@ -672,6 +672,7 @@ AC_FUNC_STRFTIME
AC_CHECK_FUNCS(putenv select poll socket strdup strerror strstr strtod strtol)
AC_CHECK_FUNCS(strtoul uname getpgid getsid getaddrinfo)
AC_CHECK_FUNCS(getipnodebyname setgroups inet_aton memrchr)
AC_CHECK_FUNCS(if_indextoname)
AC_CHECK_FUNCS(grantpt unlockpt ptsname)

View file

@ -1849,7 +1849,7 @@ xiolog_ancillary_socket(struct cmsghdr *cmsg, int *num,
provide one in parameter ins to avoid creation of a dummy socket. ins must
be <0 if it does not specify a socket fd. */
char *xiogetifname(int ind, char *val, int ins) {
#if 0
#if !HAVE_IF_INDEXTONAME
int s;
struct ifreq ifr;
@ -1878,9 +1878,9 @@ char *xiogetifname(int ind, char *val, int ins) {
if (ins < 0) Close(s);
strcpy(val, ifr.ifr_name);
return val;
#else /* ! 0 */
#else /* HAVE_IF_INDEXTONAME */
return if_indextoname(ind, val);
#endif
#endif /* HAVE_IF_INDEXTONAME */
}