Skip to content

Commit

Permalink
Fix the issue of subsystem controller files not being present when Ca…
Browse files Browse the repository at this point in the history
…lico is present

Signed-off-by: seraphGod <[email protected]>
  • Loading branch information
seraphGod authored and poiana committed Aug 8, 2024
1 parent a118b0f commit e98c999
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions userspace/libscap/linux/scap_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ static int32_t get_cgroup_subsystems_v2(struct scap_cgroup_interface* cgi, struc

char line[SCAP_MAX_PATH_SIZE];
snprintf(line, sizeof(line), "%s/cgroup.controllers", cgroup_mount);
if (access(line, F_OK) == -1) {
// If the file does not exist, return success. Skip
return SCAP_SUCCESS;
}

FILE* cgroup_controllers = fopen(line, "r");
if(!cgroup_controllers)
{
Expand Down

0 comments on commit e98c999

Please sign in to comment.