From f4fd1648e9fc84b8c301782ed39d88d92a40bb96 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 12 Jul 2009 00:05:53 +0200 Subject: [PATCH 1/2] Fix: reading mem after its freed (current_config) --- src/conky.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conky.c b/src/conky.c index 3ffb55df..726a3f07 100644 --- a/src/conky.c +++ b/src/conky.c @@ -7374,12 +7374,12 @@ static void main_loop(void) break; } #ifdef HAVE_SYS_INOTIFY_H - if (inotify_fd != -1 && inotify_config_wd == -1) { + if (inotify_fd != -1 && inotify_config_wd == -1 && current_config != 0) { inotify_config_wd = inotify_add_watch(inotify_fd, current_config, IN_MODIFY); } - if (inotify_fd != -1 && inotify_config_wd != -1) { + if (inotify_fd != -1 && inotify_config_wd != -1 && current_config != 0) { int len = 0, idx = 0; fd_set descriptors; struct timeval time_to_wait; @@ -7569,6 +7569,7 @@ void clean_up(void) } free(current_config); + current_config = 0; #ifdef TCP_PORT_MONITOR tcp_portmon_clear(); From 9e6fb9c2fe3572fa03bd8ca26c175afd28ddb6da Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 12 Jul 2009 00:51:17 +0200 Subject: [PATCH 2/2] Fix building without math but with X11 --- doc/docs.xml | 6 +++++- src/conky.c | 2 ++ src/specials.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/docs.xml b/doc/docs.xml index cb630912..6b56f351 100644 --- a/doc/docs.xml +++ b/doc/docs.xml @@ -76,7 +76,11 @@ the other libs required (depending on your configure options). You should be able to see which extra packages you need to install by reading errors that you get from - './configure'. + './configure'. You can enable/disable stuff by giving + options to configure, but be careful with disabling. For + example: with --disable-math you won't get errors but + logarithmic graphs will be normal graphs and gauges + will miss their line. Conky has (for some time) been available in the repositories of most popular distributions. Here are some diff --git a/src/conky.c b/src/conky.c index 726a3f07..25b0686a 100644 --- a/src/conky.c +++ b/src/conky.c @@ -6522,8 +6522,10 @@ static void draw_line(char *s) { int h, by = 0; unsigned long last_colour = current_color; +#ifdef MATH float angle, px, py; int usage; +#endif /* MATH */ if (cur_x - text_start_x > maximum_width && maximum_width > 0) { diff --git a/src/specials.c b/src/specials.c index f8007d74..1a624483 100644 --- a/src/specials.c +++ b/src/specials.c @@ -254,11 +254,11 @@ static void graph_append(struct special_t *graph, double f, char showaslog) { int i; -#ifdef MATH if (showaslog) { +#ifdef MATH f = log10(f + 1); - } #endif + } if (!graph->scaled && f > graph->graph_scale) { f = graph->graph_scale;