From 39ba74a590c4b0980061215237d77498e6955f1e Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sun, 7 Dec 2008 15:54:40 -0700 Subject: [PATCH] Don't put unit with hddtemp values for consistency (bug 2133107) --- ChangeLog | 1 + src/conky.c | 8 ++++---- src/hddtemp.c | 4 ++-- src/hddtemp.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdd00fa0..4bcd6fbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ tracker bug #2166612) * Allow more than 9 CPUs for CPU stats (bug 2155500) * Fix broken $execbar (bug 2133709) + * Don't put unit with hddtemp values for consistency (bug 2133107) 2008-12-06 * Switching from svn to git repository. The repo can be viewed from diff --git a/src/conky.c b/src/conky.c index 7f8e3fee..b612d4a2 100644 --- a/src/conky.c +++ b/src/conky.c @@ -5640,7 +5640,7 @@ static void generate_text_internal(char *p, int p_max_size, OBJ(hddtemp) { if (obj->data.hddtemp.update_time < current_update_time - 30) { char *str = get_hddtemp_info(obj->data.hddtemp.dev, - obj->data.hddtemp.addr, obj->data.hddtemp.port, &obj->data.hddtemp.unit); + obj->data.hddtemp.addr, obj->data.hddtemp.port/*, &obj->data.hddtemp.unit*/); if (str) { strncpy(obj->data.hddtemp.temp, str, text_buffer_size); } else { @@ -5650,10 +5650,10 @@ static void generate_text_internal(char *p, int p_max_size, } if (!obj->data.hddtemp.temp) { snprintf(p, p_max_size, "N/A"); - } else if (obj->data.hddtemp.unit == '*') { + } else/* if (obj->data.hddtemp.unit == '*')*/ { snprintf(p, p_max_size, "%s", obj->data.hddtemp.temp); - } else { - snprintf(p, p_max_size, "%s%c", obj->data.hddtemp.temp, obj->data.hddtemp.unit); +/* } else { + snprintf(p, p_max_size, "%s%c", obj->data.hddtemp.temp, obj->data.hddtemp.unit);*/ } } #endif diff --git a/src/hddtemp.c b/src/hddtemp.c index 22566ba3..f3d562a8 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -74,7 +74,7 @@ int scan_hddtemp(const char *arg, char **dev, char **addr, int *port, char** tem return 0; } -char *get_hddtemp_info(char *dev, char *hostaddr, int port, char *unit) +char *get_hddtemp_info(char *dev, char *hostaddr, int port/*, char *unit*/) { int sockfd = 0; struct hostent he, *he_res = 0; @@ -181,7 +181,7 @@ char *get_hddtemp_info(char *dev, char *hostaddr, int port, char *unit) } *p = '\0'; p++; - *unit = *p; +// *unit = *p; if (!strncmp(out, "NA", 2)) { strncpy(buf, "N/A", BUFLEN); r = buf; diff --git a/src/hddtemp.h b/src/hddtemp.h index 2bd14677..38b57cb8 100644 --- a/src/hddtemp.h +++ b/src/hddtemp.h @@ -2,6 +2,6 @@ #define HDDTEMP_H_ int scan_hddtemp(const char *arg, char **dev, char **addr, int *port, char **temp); -char *get_hddtemp_info(char *dev, char *addr, int port, char *unit); +char *get_hddtemp_info(char *dev, char *addr, int port/*, char *unit*/); #endif /*HDDTEMP_H_*/