contrib/package/freifunk-watchdog: better handle checking for uci updates
This commit is contained in:
parent
b385476f7e
commit
95814fcd1a
1 changed files with 2 additions and 14 deletions
|
@ -137,16 +137,6 @@ static int check_uci_update(const char *config, time_t *mtime)
|
|||
struct stat s;
|
||||
char path[128];
|
||||
|
||||
snprintf(path, sizeof(path), "/etc/config/%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 )
|
||||
{
|
||||
|
@ -155,11 +145,9 @@ static int check_uci_update(const char *config, time_t *mtime)
|
|||
*mtime = s.st_mtime;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue