Skip to content

Commit

Permalink
Merge pull request eclipse#6984 from janvrany/pr/fix-groups2-initiali…
Browse files Browse the repository at this point in the history
…zation

Fix Linux cgroup2 initialization
  • Loading branch information
babsingh committed May 11, 2023
2 parents 32e4cfe + b544b75 commit 779c51b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions port/unix/omrsysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6112,6 +6112,7 @@ populateCgroupEntryListV2(struct OMRPortLibrary *portLibrary, int pid, OMRCgroup
*/
char subsystems[PATH_MAX];
char *cursor = NULL;
char *newline = NULL;
char *separator = NULL;

Assert_PRT_true(NULL != cgroupEntryList);
Expand Down Expand Up @@ -6184,6 +6185,15 @@ populateCgroupEntryListV2(struct OMRPortLibrary *portLibrary, int pid, OMRCgroup
}

cursor = subsystems;

/* Strip the \n at the end (see Linux kernel source, file
* kernel/cgroup/cgroup.c, function cgroup_print_ss_mask()).
*/
newline = strchr(cursor, '\n');
if (NULL != newline) {
*newline = '\0';
}

do {
int32_t i = 0;

Expand Down

0 comments on commit 779c51b

Please sign in to comment.