}
for(i = 0; i < range->num_frequency; i++)
- {
+ {
cmp_freq = ((double)range->freq[i].m) * pow(10, range->freq[i].e);
if( cmp_freq == cur_freq )
{
struct stat s;
char path[128];
- snprintf(path, sizeof(path), "/etc/config/%s", config);
+ snprintf(path, sizeof(path), "/var/state/%s", config);
if( stat(path, &s) > -1 )
{
if( (*mtime == 0) || (s.st_mtime > *mtime) )
*mtime = s.st_mtime;
return 1;
}
- else
- {
- snprintf(path, sizeof(path), "/var/state/%s", config);
- if( stat(path, &s) > -1 )
- {
- if( (*mtime == 0) || (s.st_mtime > *mtime) )
- {
- *mtime = s.st_mtime;
- return 1;
- }
- }
- return 0;
- }
+ return 0;
}
return -1;
}
/* Check channel */
- if( channel != curif->channel )
+ else if( channel != curif->channel )
{
syslog(LOG_WARNING, "Channel mismatch on %s: current=%d wanted=%d",
curif->ifname, channel, curif->channel);
/* Wifi restart required? */
- if( restart_wifi > 0 )
+ if( restart_wifi >= HYSTERESIS )
{
restart_wifi = 0;
+ syslog(LOG_WARNING, "Restarting wireless");
EXEC(WIFI_ACTION);
}
/* Cron restart required? */
- if( restart_cron > 0 )
+ if( restart_cron >= HYSTERESIS )
{
restart_cron = 0;
+ syslog(LOG_WARNING, "Restarting crond process");
EXEC(CRON_ACTION);
}