Merge pull request #7293 from spearlineltd/fixhang

Fix hang when `path` doesn't exist
This commit is contained in:
OpenShift Merge Robot
2020-08-13 13:01:18 +02:00
committed by GitHub

View File

@@ -389,14 +389,12 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st
lastErr = nil
break
} else {
fds, err := unix.Socketpair(unix.AF_UNIX, unix.SOCK_DGRAM, 0)
r, w, err := os.Pipe()
if err != nil {
lastErr = err
continue
}
r, w := os.NewFile(uintptr(fds[0]), "read file"), os.NewFile(uintptr(fds[1]), "write file")
defer errorhandling.CloseQuiet(r)
if _, _, err := becomeRootInUserNS("", path, w); err != nil {