projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b385476
)
contrib/package/freifunk-watchdog: better handle checking for uci updates
author
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 9 May 2009 15:28:37 +0000
(15:28 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 9 May 2009 15:28:37 +0000
(15:28 +0000)
contrib/package/freifunk-watchdog/src/watchdog.c
patch
|
blob
|
history
diff --git
a/contrib/package/freifunk-watchdog/src/watchdog.c
b/contrib/package/freifunk-watchdog/src/watchdog.c
index
d4ccff8
..
c269f22
100644
(file)
--- a/
contrib/package/freifunk-watchdog/src/watchdog.c
+++ b/
contrib/package/freifunk-watchdog/src/watchdog.c
@@
-137,7
+137,7
@@
static int check_uci_update(const char *config, time_t *mtime)
struct stat s;
char path[128];
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) )
if( stat(path, &s) > -1 )
{
if( (*mtime == 0) || (s.st_mtime > *mtime) )
@@
-145,20
+145,8
@@
static int check_uci_update(const char *config, time_t *mtime)
*mtime = s.st_mtime;
return 1;
}
*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;
}
return -1;