mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-10 16:08:31 +00:00
apcupsd: drop init_apcupsd() since it was called at the wrong place
Normally, this is not enough reason to remove code, but in this case it means that either the tester always had $nvidia (if enabled) or $combine also in her setup, or it was working without (which I guess, since there is duplicate code in update_apcupsd()).
This commit is contained in:
parent
9dd360ecdb
commit
fa896bec98
@ -227,15 +227,3 @@ void update_apcupsd(void) {
|
|||||||
memcpy(info.apcupsd.items, apc.items, sizeof(info.apcupsd.items));
|
memcpy(info.apcupsd.items, apc.items, sizeof(info.apcupsd.items));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// fills in the N/A strings and default host:port
|
|
||||||
//
|
|
||||||
void init_apcupsd(void) {
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < _APCUPSD_COUNT; ++i)
|
|
||||||
memcpy(info.apcupsd.items[i], "N/A", 4); // including \0
|
|
||||||
memcpy(info.apcupsd.host, "localhost", 10);
|
|
||||||
info.apcupsd.port = htons(3551);
|
|
||||||
}
|
|
||||||
|
@ -51,7 +51,4 @@ typedef struct apcupsd_s {
|
|||||||
/* Service routine for the conky main thread */
|
/* Service routine for the conky main thread */
|
||||||
void update_apcupsd(void);
|
void update_apcupsd(void);
|
||||||
|
|
||||||
/* fill in the default values */
|
|
||||||
void init_apcupsd(void);
|
|
||||||
|
|
||||||
#endif /*APCUPSD_H_*/
|
#endif /*APCUPSD_H_*/
|
||||||
|
@ -2123,7 +2123,6 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
}
|
}
|
||||||
#endif /* NVIDIA */
|
#endif /* NVIDIA */
|
||||||
#ifdef APCUPSD
|
#ifdef APCUPSD
|
||||||
init_apcupsd();
|
|
||||||
END OBJ(apcupsd, &update_apcupsd)
|
END OBJ(apcupsd, &update_apcupsd)
|
||||||
if (arg) {
|
if (arg) {
|
||||||
char host[64];
|
char host[64];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user