Bugfix for directories

Fixed handling of cgroup directories with various names by ensuring correct generation of the `cgroup.events` file path
This commit is contained in:
2024-09-14 10:21:03 +02:00
parent f239381423
commit 1b237cb8a8

View File

@@ -88,7 +88,9 @@ void monitor_directory(const char *dir) {
handle_cgroup_event(cgroup_event_path);
}
} else if(event->mask & IN_MODIFY) {
handle_cgroup_event(event->name);
char cgroup_event_path[1024];
snprintf(cgroup_event_path, sizeof(cgroup_event_path), "%s/%s/cgroup.events", dir, event->name);
handle_cgroup_event(cgroup_event_path);
}
}
}
@@ -120,4 +122,4 @@ int main(int argc, char *argv[]) {
}
return 0;
}
}