mirror of
https://repo.or.cz/socat.git
synced 2024-12-23 07:52:32 +00:00
Cygwin port: if_indextoname() conditional
This commit is contained in:
parent
a6699a96b5
commit
ee504a7bad
3 changed files with 7 additions and 3 deletions
|
@ -107,6 +107,9 @@
|
||||||
/* Define if you have the memrchr function. */
|
/* Define if you have the memrchr function. */
|
||||||
#undef HAVE_MEMRCHR
|
#undef HAVE_MEMRCHR
|
||||||
|
|
||||||
|
/* Define if you have the if_indextoname function. */
|
||||||
|
#undef HAVE_IF_INDEXTONAME
|
||||||
|
|
||||||
/* Define if you have the sigaction function */
|
/* Define if you have the sigaction function */
|
||||||
#undef HAVE_SIGACTION
|
#undef HAVE_SIGACTION
|
||||||
|
|
||||||
|
|
|
@ -672,6 +672,7 @@ AC_FUNC_STRFTIME
|
||||||
AC_CHECK_FUNCS(putenv select poll socket strdup strerror strstr strtod strtol)
|
AC_CHECK_FUNCS(putenv select poll socket strdup strerror strstr strtod strtol)
|
||||||
AC_CHECK_FUNCS(strtoul uname getpgid getsid getaddrinfo)
|
AC_CHECK_FUNCS(strtoul uname getpgid getsid getaddrinfo)
|
||||||
AC_CHECK_FUNCS(getipnodebyname setgroups inet_aton memrchr)
|
AC_CHECK_FUNCS(getipnodebyname setgroups inet_aton memrchr)
|
||||||
|
AC_CHECK_FUNCS(if_indextoname)
|
||||||
|
|
||||||
AC_CHECK_FUNCS(grantpt unlockpt ptsname)
|
AC_CHECK_FUNCS(grantpt unlockpt ptsname)
|
||||||
|
|
||||||
|
|
|
@ -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
|
provide one in parameter ins to avoid creation of a dummy socket. ins must
|
||||||
be <0 if it does not specify a socket fd. */
|
be <0 if it does not specify a socket fd. */
|
||||||
char *xiogetifname(int ind, char *val, int ins) {
|
char *xiogetifname(int ind, char *val, int ins) {
|
||||||
#if 0
|
#if !HAVE_IF_INDEXTONAME
|
||||||
int s;
|
int s;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
|
|
||||||
|
@ -1878,9 +1878,9 @@ char *xiogetifname(int ind, char *val, int ins) {
|
||||||
if (ins < 0) Close(s);
|
if (ins < 0) Close(s);
|
||||||
strcpy(val, ifr.ifr_name);
|
strcpy(val, ifr.ifr_name);
|
||||||
return val;
|
return val;
|
||||||
#else /* ! 0 */
|
#else /* HAVE_IF_INDEXTONAME */
|
||||||
return if_indextoname(ind, val);
|
return if_indextoname(ind, val);
|
||||||
#endif
|
#endif /* HAVE_IF_INDEXTONAME */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue