From d251d9272a97f26778e3bbfbcac4dfcc473b4ed5 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 17 Feb 2018 19:20:54 +0100 Subject: [PATCH] cgfsng: cg_is_pure_unified() Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 9ecbf5ac7..a2f4bd369 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1333,19 +1333,20 @@ static bool cg_hybrid_init(void) return true; } -static int cg_is_pure_unified(void) { +static int cg_is_pure_unified(void) +{ int ret; - struct statfs fs; + struct statfs fs; - ret = statfs("/sys/fs/cgroup", &fs); - if (ret < 0) - return -ENOMEDIUM; + ret = statfs("/sys/fs/cgroup", &fs); + if (ret < 0) + return -ENOMEDIUM; - if (is_fs_type(&fs, CGROUP2_SUPER_MAGIC)) + if (is_fs_type(&fs, CGROUP2_SUPER_MAGIC)) return CGROUP2_SUPER_MAGIC; - return 0; + return 0; } /* Get current cgroup from /proc/self/cgroup for the cgroupfs v2 hierarchy. */ -- 2.47.2