From: Tom Hromatka Date: Mon, 11 May 2020 02:20:40 +0000 (+0000) Subject: api.c: Add support for cgroup v2 to cg_test_mounted_fs() X-Git-Tag: v2.0.rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e050fba4dc56af30403721558bc88a953b0d211;p=thirdparty%2Flibcgroup.git api.c: Add support for cgroup v2 to cg_test_mounted_fs() This commit adds a string comparison of "cgroup2" to cg_test_mounted_fs(). This allows cgroup v2 mounts to pass the filesystem check and thus cgroups can be created. Signed-off-by: Tom Hromatka Acked-by: Dhaval Giani --- diff --git a/src/api.c b/src/api.c index bef9ea26..2ced9298 100644 --- a/src/api.c +++ b/src/api.c @@ -1315,7 +1315,8 @@ static int cg_test_mounted_fs(void) goto done; } - while (strcmp(ent->mnt_type, "cgroup") != 0) { + while (strcmp(ent->mnt_type, "cgroup") != 0 && + strcmp(ent->mnt_type, "cgroup2") != 0) { ent = getmntent_r(proc_mount, temp_ent, mntent_buff, sizeof(mntent_buff)); if (ent == NULL) {