From e46791e003444ce825feaf5bb2a16f778ee951e5 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Fri, 17 Jul 2015 20:07:45 +0300 Subject: [PATCH] nodeinfo: fix build on FreeBSD Currently, build fails on FreeBSD with: CC libvirt_driver_la-nodeinfo.lo nodeinfo.c:1941:56: error: use of undeclared identifier 'SYSFS_SYSTEM_PATH' const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH; ^ 1 error generated. This is caused by commit b97b3048 that added sysfs_prefix to nodeCapsInitNUMA and used SYSFS_CPU_PATH. Fix it by unconditionally defining SYSFS_CPU_PATH instead of defining it under #ifdef __linux__. --- src/nodeinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nodeinfo.c b/src/nodeinfo.c index c874fa6729..d7d022395f 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -59,6 +59,8 @@ VIR_LOG_INIT("nodeinfo"); +#define SYSFS_SYSTEM_PATH "/sys/devices/system" + #if defined(__FreeBSD__) || defined(__APPLE__) static int appleFreebsdNodeGetCPUCount(void) @@ -283,7 +285,6 @@ freebsdNodeGetMemoryStats(virNodeMemoryStatsPtr params, #ifdef __linux__ # define CPUINFO_PATH "/proc/cpuinfo" -# define SYSFS_SYSTEM_PATH "/sys/devices/system" # define PROCSTAT_PATH "/proc/stat" # define MEMINFO_PATH "/proc/meminfo" # define SYSFS_MEMORY_SHARED_PATH "/sys/kernel/mm/ksm" -- GitLab