mirror of
https://github.com/troglobit/finit.git
synced 2026-10-15 10:29:35 +00:00
devmon: re-evaluate device conditions on reconf
Device conditions tracked by devmon were lost on `initctl reload` because the reconf path did not re-assert them. Add devmon_reconf() to iterate all tracked device nodes and set or clear their conditions based on current device presence. Signed-off-by: Mattias Walström <lazzer@gmail.com>
This commit is contained in:
4 files changed
+24
No files matched your search
@@ -113,6 +113,20 @@ void devmon_del_cond(const char *cond)
|
||||
drop_node(find_node(cond));
|
||||
}
|
||||
|
||||
void devmon_reconf(void)
|
||||
{
|
||||
struct dev_node *node, *tmp;
|
||||
char path[PATH_MAX];
|
||||
|
||||
TAILQ_FOREACH_SAFE(node, &dev_node_list, link, tmp) {
|
||||
snprintf(path, sizeof(path), "/%s", node->name);
|
||||
if (fexist(path))
|
||||
cond_set(node->name);
|
||||
else
|
||||
cond_clear(node->name);
|
||||
}
|
||||
}
|
||||
|
||||
static int devmon_add_path(struct iwatch *iw, char *path)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
Reference in new issue
Block a user