We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 111e8dc commit 33315a0Copy full SHA for 33315a0
libcontainer/utils/utils_unix.go
@@ -103,7 +103,13 @@ func CloseExecFrom(minFd int) error {
103
// Use close_range(CLOSE_RANGE_CLOEXEC) if possible.
104
if haveCloseRangeCloexec() {
105
err := unix.CloseRange(uint(minFd), math.MaxInt32, unix.CLOSE_RANGE_CLOEXEC)
106
- return os.NewSyscallError("close_range", err)
+ if err == nil {
107
+ return nil
108
+ }
109
+
110
+ logrus.Debugf("close_range failed, closing range one at a time (error: %v)", err)
111
112
+ // If close_range fails, we fall back to the standard loop.
113
}
114
// Otherwise, fall back to the standard loop.
115
return fdRangeFrom(minFd, unix.CloseOnExec)
0 commit comments