1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 20:11:11 +00:00

Don't put unit with hddtemp values for consistency (bug 2133107)

This commit is contained in:
Brenden Matthews 2008-12-07 15:54:40 -07:00
parent 1fcbecf4af
commit 39ba74a590
4 changed files with 8 additions and 7 deletions

View File

@ -3,6 +3,7 @@
tracker bug #2166612) tracker bug #2166612)
* Allow more than 9 CPUs for CPU stats (bug 2155500) * Allow more than 9 CPUs for CPU stats (bug 2155500)
* Fix broken $execbar (bug 2133709) * Fix broken $execbar (bug 2133709)
* Don't put unit with hddtemp values for consistency (bug 2133107)
2008-12-06 2008-12-06
* Switching from svn to git repository. The repo can be viewed from * Switching from svn to git repository. The repo can be viewed from

View File

@ -5640,7 +5640,7 @@ static void generate_text_internal(char *p, int p_max_size,
OBJ(hddtemp) { OBJ(hddtemp) {
if (obj->data.hddtemp.update_time < current_update_time - 30) { if (obj->data.hddtemp.update_time < current_update_time - 30) {
char *str = get_hddtemp_info(obj->data.hddtemp.dev, 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) { if (str) {
strncpy(obj->data.hddtemp.temp, str, text_buffer_size); strncpy(obj->data.hddtemp.temp, str, text_buffer_size);
} else { } else {
@ -5650,10 +5650,10 @@ static void generate_text_internal(char *p, int p_max_size,
} }
if (!obj->data.hddtemp.temp) { if (!obj->data.hddtemp.temp) {
snprintf(p, p_max_size, "N/A"); 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); snprintf(p, p_max_size, "%s", obj->data.hddtemp.temp);
} else { /* } else {
snprintf(p, p_max_size, "%s%c", obj->data.hddtemp.temp, obj->data.hddtemp.unit); snprintf(p, p_max_size, "%s%c", obj->data.hddtemp.temp, obj->data.hddtemp.unit);*/
} }
} }
#endif #endif

View File

@ -74,7 +74,7 @@ int scan_hddtemp(const char *arg, char **dev, char **addr, int *port, char** tem
return 0; 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; int sockfd = 0;
struct hostent he, *he_res = 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 = '\0';
p++; p++;
*unit = *p; // *unit = *p;
if (!strncmp(out, "NA", 2)) { if (!strncmp(out, "NA", 2)) {
strncpy(buf, "N/A", BUFLEN); strncpy(buf, "N/A", BUFLEN);
r = buf; r = buf;

View File

@ -2,6 +2,6 @@
#define HDDTEMP_H_ #define HDDTEMP_H_
int scan_hddtemp(const char *arg, char **dev, char **addr, int *port, char **temp); 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_*/ #endif /*HDDTEMP_H_*/