diff options
-rw-r--r-- | anzeige.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -10,6 +10,7 @@ #include <pthread.h> #include <signal.h> #include <time.h> +#include <netdb.h> #include "fonts.h" #include "input_gadgets.h" @@ -20,6 +21,7 @@ void handle_signals(int signo); t_scroll_data scroll_data; time_t next_update = 0; +time_t next_dns_query = 0; int main(int argc, char **argv) { @@ -80,6 +82,7 @@ int main(int argc, char **argv) } if ((time(NULL) >= next_update) && (scroll_data . update == 0)) { next_update = time(NULL) + 600; // 10 minutes ahead + next_dns_query = time(NULL) + 30; // 1/2 minute ahead memset(text_buffer, 0, TEXT_BUFFER_LENGTH); @@ -148,6 +151,13 @@ int main(int argc, char **argv) ); scroll_data . update = 1; } + if (time(NULL) >= next_dns_query) { + next_dns_query = time(NULL) + 30; // 1/2 minute ahead + gethostbyname("wetter.mb.fh-jena.de"); + gethostbyname("api.met.no"); + gethostbyname("opendata.dwd.de"); + gethostbyname("kpi.ddns.eckner.net"); + } usleep(100000); } |