From e76f0c85871651adfc6c3c92125d898aea9ea1a4 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sun, 19 Jul 2009 14:55:41 -0600 Subject: [PATCH 1/2] Exit properly when forking. --- src/conky.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conky.c b/src/conky.c index 9c73e38d..ed771724 100644 --- a/src/conky.c +++ b/src/conky.c @@ -9283,7 +9283,7 @@ void initialisation(int argc, char **argv) { fprintf(stderr, PACKAGE_NAME": forked to background, pid is %d\n", pid); fflush(stderr); - return; + exit(EXIT_SUCCESS); } } From 80a71ea8bd7da0dc352f7ef7261a2e59f5c747e4 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sun, 19 Jul 2009 15:28:19 -0600 Subject: [PATCH 2/2] Handle curl errors better (in weather and rss). --- src/Makefile.am | 2 +- src/rss.c | 2 +- src/weather.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 021e6b1a..dbbec2e9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -245,4 +245,4 @@ EXTRA_DIST = \ imlib2.h -# vi:set ts=8 sw=8 noet ai nocindent syntax=automake: +# vi:set ts=4 sw=4 noet ai nocindent syntax=automake: diff --git a/src/rss.c b/src/rss.c index 75a65955..5bdbc8a5 100644 --- a/src/rss.c +++ b/src/rss.c @@ -144,7 +144,7 @@ PRSS *get_rss_info(char *uri, int delay) curl_easy_setopt(curl, CURLOPT_USERAGENT, "conky-rss/1.0"); res = curl_easy_perform(curl); - if (chunk.size) { + if (res == CURLE_OK && chunk.size) { curdata = prss_parse_data(chunk.memory); free(chunk.memory); } else { diff --git a/src/weather.c b/src/weather.c index 7c3380c4..868737a0 100644 --- a/src/weather.c +++ b/src/weather.c @@ -552,7 +552,7 @@ void fetch_weather_info(location *curloc) curl_easy_setopt(curl, CURLOPT_USERAGENT, "conky-weather/1.0"); res = curl_easy_perform(curl); - if (chunk.size) { + if (res == CURLE_OK && chunk.size) { timed_thread_lock(curloc->p_timed_thread); parse_weather(&curloc->data, chunk.memory); timed_thread_unlock(curloc->p_timed_thread);