commit - 6a76b2a232c7a2636e9b2060bee394f867a760b8
commit + 754bfa41a9402a6b94ade8742fe81f8c3799e34b
blob - 6181d1bb7c8f9ca62d555a8ea2a4d641a4f069ec
blob + 1c4546a812004569752d41c3e74f859f621e5cb9
--- src/main.c
+++ src/main.c
static volatile sig_atomic_t reload_config = 0;
static volatile sig_atomic_t reload_mail = 0;
static volatile sig_atomic_t reload_battery = 0;
+static volatile sig_atomic_t reload_weather = 0;
static bool weather_loc_valid = false;
static bool mail_path_valid = false;
case SIGCHLD:
while (waitpid(-1, NULL, WNOHANG) > 0);
break;
+ case SIGWINCH:
+ reload_weather = 1;
+ break;
case SIGUSR1:
reload_mail = 1;
break;
if (sigaction(SIGINT, &sa, NULL) == -1) perror("sigaction");
if (sigaction(SIGHUP, &sa, NULL) == -1) perror("sigaction");
if (sigaction(SIGCHLD, &sa, NULL) == -1) perror("sigaction");
+ if (sigaction(SIGWINCH, &sa, NULL) == -1) perror("sigaction");
if (sigaction(SIGUSR1, &sa, NULL) == -1) perror("sigaction");
if (sigaction(SIGUSR2, &sa, NULL) == -1) perror("sigaction");
}
}
/* Weather */
- if (weather_loc_valid && weather_pfd && timespeccmp(&now, &clocks[WEATHER_CLOCK], >=))
+ if (weather_loc_valid && weather_pfd && (reload_weather == 1 || timespeccmp(&now, &clocks[WEATHER_CLOCK], >=)))
{
+ reload_weather = 0;
get_weather(weather_pipe[1]);
while (timespeccmp(&now, &clocks[WEATHER_CLOCK], >=))
timespecadd(&clocks[WEATHER_CLOCK], &weather_interval, &clocks[WEATHER_CLOCK]);