From 71a60672a841e23d7195d89cce7c05cd49704b02 Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Sun, 2 Dec 2018 16:29:56 +0000 Subject: [PATCH] When compiling with gcc the file /usr/include/machine/md_var.h is included. This header defines a function "void cpu_setup(u_int)" which clashes with the "static short cpu_setup" variable in src/freebsd.cc. (#686) The patch renames this variable. Reported by: Piotr Kubaj Ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233616 --- src/freebsd.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freebsd.cc b/src/freebsd.cc index 4a122724..00c7dc30 100644 --- a/src/freebsd.cc +++ b/src/freebsd.cc @@ -76,7 +76,7 @@ __attribute__((gnu_inline)) inline void proc_find_top(struct process **cpu, struct process **mem, struct process **time); -static short cpu_setup = 0; +static short conky_cpu_setup = 0; static int getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; @@ -301,9 +301,9 @@ int update_cpu_usage(void) { extern void *global_cpu; /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */ - if ((cpu_setup == 0) || (!info.cpu_usage)) { + if ((conky_cpu_setup == 0) || (!info.cpu_usage)) { get_cpu_count(); - cpu_setup = 1; + conky_cpu_setup = 1; } if (!global_cpu) {