mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
rootless: do not close files twice
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
78bf6d0c6e
commit
9a61b765d0
|
@ -566,10 +566,10 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st
|
|||
|
||||
r, w := os.NewFile(uintptr(fds[0]), "read file"), os.NewFile(uintptr(fds[1]), "write file")
|
||||
|
||||
defer errorhandling.CloseQuiet(w)
|
||||
defer errorhandling.CloseQuiet(r)
|
||||
|
||||
if _, _, err := becomeRootInUserNS("", path, w); err != nil {
|
||||
w.Close()
|
||||
lastErr = err
|
||||
continue
|
||||
}
|
||||
|
@ -578,7 +578,6 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st
|
|||
return false, 0, err
|
||||
}
|
||||
defer func() {
|
||||
errorhandling.CloseQuiet(r)
|
||||
C.reexec_in_user_namespace_wait(-1, 0)
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in a new issue