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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user