libct: move cmsg helpers to new internal/cmsg package

These helpers all make more sense as a self-contained package and moving
them has the added benefit of removing an unneeded libpathrs dependency
(from libcontainer/utils's import of pathrs-lite) from several test
binaries.

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This commit is contained in:
Aleksa Sarai
2026-04-07 19:47:57 +10:00
parent 80fc1cd34e
commit ca509e76ff
10 changed files with 63 additions and 20 deletions
+4 -3
View File
@@ -34,8 +34,9 @@ import (
"sync"
"github.com/containerd/console"
"github.com/opencontainers/runc/libcontainer/utils"
"github.com/urfave/cli"
"github.com/opencontainers/runc/internal/cmsg"
)
// version will be populated by the Makefile, read from
@@ -100,7 +101,7 @@ func handleSingle(path string, noStdin bool) error {
defer socket.Close()
// Get the master file descriptor from runC.
master, err := utils.RecvFile(socket)
master, err := cmsg.RecvFile(socket)
if err != nil {
return err
}
@@ -163,7 +164,7 @@ func handleNull(path string) error {
defer socket.Close()
// Get the master file descriptor from runC.
master, err := utils.RecvFile(socket)
master, err := cmsg.RecvFile(socket)
if err != nil {
return
}