mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct: add a defer fd close in createDeviceNode
Signed-off-by: lifubang <lifubang@acmcoder.com> (cherry picked from commit 9a5e6262f0bf4e3e654b1a0d71bb804093948f85) Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
@@ -997,6 +997,8 @@ func createDeviceNode(rootfs string, node *devices.Device, bind bool) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("mkdir parent of device inode %q: %w", node.Path, err)
|
||||
}
|
||||
defer destDir.Close()
|
||||
|
||||
if bind {
|
||||
return bindMountDeviceNode(destDir, destName, node)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user