]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
api.c: Add support for cgroup v2 to cg_test_mounted_fs()
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 11 May 2020 02:20:40 +0000 (02:20 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 16 Jun 2020 14:43:57 +0000 (08:43 -0600)
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 <tom.hromatka@oracle.com>
Acked-by: Dhaval Giani <dhaval.giani@oracle.com>
src/api.c

index bef9ea263f43b6316d60aba01edbeecfd95354d2..2ced9298a2752d7ff787e70a502a18330b0693de 100644 (file)
--- 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) {