mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
update machinery: fix for update_stat() on linux
This commit is contained in:
parent
47c88b2149
commit
466a253a8c
@ -616,6 +616,14 @@ inline static void update_stat(void)
|
||||
const char *stat_template = NULL;
|
||||
unsigned int malloc_cpu_size = 0;
|
||||
extern void* global_cpu;
|
||||
static double last_stat_update = 0.0;
|
||||
|
||||
/* since we use wrappers for this function, the update machinery
|
||||
* can't eliminate double invocations of this function. Check for
|
||||
* them here, otherwise cpu_usage counters are freaking out. */
|
||||
if (last_stat_update == current_update_time)
|
||||
return;
|
||||
last_stat_update = current_update_time;
|
||||
|
||||
/* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */
|
||||
if (!cpu_setup || !info.cpu_usage) {
|
||||
|
Loading…
Reference in New Issue
Block a user