提交 0fc454ce 编写于 作者: M Martin Kletzander

Use stub for virNetDevGetName on mingw

If if_indextoname is not defined, the whole function using it should
not be defined either.  Add stub to fix build on mingw.

Caused by 5dd60705Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 5498aa29
......@@ -319,9 +319,10 @@ AC_CHECK_SIZEOF([long])
dnl Availability of various common functions (non-fatal if missing),
dnl and various less common threadsafe functions
AC_CHECK_FUNCS_ONCE([cfmakeraw fallocate geteuid getgid getgrnam_r \
getmntent_r getpwuid_r getrlimit getuid kill mmap newlocale posix_fallocate \
posix_memalign prlimit regexec sched_getaffinity setgroups setns \
setrlimit symlink sysctlbyname getifaddrs sched_setscheduler unshare])
getmntent_r getpwuid_r getrlimit getuid if_indextoname kill mmap \
newlocale posix_fallocate posix_memalign prlimit regexec \
sched_getaffinity setgroups setns setrlimit symlink sysctlbyname \
getifaddrs sched_setscheduler unshare])
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \
......
......@@ -852,6 +852,7 @@ virNetDevGetRcvAllMulti(const char *ifname,
return virNetDevGetIFFlag(ifname, VIR_IFF_ALLMULTI, receive);
}
#if defined(HAVE_IF_INDEXTONAME)
char *virNetDevGetName(int ifindex)
{
char name[IFNAMSIZ];
......@@ -871,6 +872,15 @@ char *virNetDevGetName(int ifindex)
cleanup:
return ifname;
}
#else
char *virNetDevGetName(int ifindex)
{
virReportSystemError(ENOSYS,
_("Cannot get interface name for index '%i'"),
ifindex);
return NULL;
}
#endif
/**
* virNetDevGetIndex:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册