From: Eric Blake Date: Sun, 3 Aug 2014 02:47:36 +0000 (-0600) Subject: build: fix build on cygwin X-Git-Tag: v1.2.7~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=478d93ad1f83084bb0277fec07e1ef441a09018f;p=thirdparty%2Flibvirt.git build: fix build on cygwin Cygwin has getifaddrs(), but not AF_LINK, leading to: util/virstats.c: In function 'virNetInterfaceStats': util/virstats.c:138:41: error: 'AF_LINK' undeclared (first use in this function) if (ifa->ifa_addr->sa_family != AF_LINK) ... * src/util/virstats.c (virNetInterfaceStats): Only use getifaddrs if AF_LINK is present. Signed-off-by: Eric Blake --- diff --git a/src/util/virstats.c b/src/util/virstats.c index 910803f2b3..b10fd851fc 100644 --- a/src/util/virstats.c +++ b/src/util/virstats.c @@ -1,7 +1,7 @@ /* * virstats.c: Block and network stats. * - * Copyright (C) 2007-2010 Red Hat, Inc. + * Copyright (C) 2007-2010, 2014 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,7 +29,7 @@ #include #include -#ifdef HAVE_GETIFADDRS +#if defined(HAVE_GETIFADDRS) && defined(AF_LINK) # include # include #endif @@ -119,7 +119,7 @@ virNetInterfaceStats(const char *path, _("/proc/net/dev: Interface not found")); return -1; } -#elif defined(HAVE_GETIFADDRS) +#elif defined(HAVE_GETIFADDRS) && defined(AF_LINK) int virNetInterfaceStats(const char *path, struct _virDomainInterfaceStats *stats)