libct: mountCgroupV1: address TODO

Indeed, it does not make sense to prepend c.root once we started using
MkdirAllInRoot in commit 63c29081.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 60352524d3)
Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
Kir Kolyshkin
2026-03-18 17:17:27 -07:00
committed by lifubang
parent 4d5dc51e5d
commit a4afb37ba7
+1 -3
View File
@@ -336,10 +336,8 @@ func mountCgroupV1(m mountEntry, c *mountConfig) error {
// We just created the tmpfs, and so we can just use filepath.Join
// here (not to mention we want to make sure we create the path
// inside the tmpfs, so we don't want to resolve symlinks).
// TODO: Why not just use b.Destination (c.root is the root here)?
subsystemPath := filepath.Join(c.root, b.Destination)
subsystemName := filepath.Base(b.Destination)
subsystemDir, err := pathrs.MkdirAllInRoot(c.root, subsystemPath, 0o755)
subsystemDir, err := pathrs.MkdirAllInRoot(c.root, b.Destination, 0o755)
if err != nil {
return err
}