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:
Mattias Walström committed 2026-02-10 20:09:35 +01:00
1 parent 109d8826bd
commit b206c3d655
4 files changed
+24

No files matched your search

+14
View File
@@ -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;