mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-07 16:31:38 +08:00
libcontainer: Use MaxInt32 as the last FD to match kernel size semantics
Signed-off-by: Evan Phoenix <evan@phx.io>
This commit is contained in:
@@ -102,7 +102,7 @@ func fdRangeFrom(minFd int, fn fdFunc) error {
|
||||
func CloseExecFrom(minFd int) error {
|
||||
// Use close_range(CLOSE_RANGE_CLOEXEC) if possible.
|
||||
if haveCloseRangeCloexec() {
|
||||
err := unix.CloseRange(uint(minFd), math.MaxUint, unix.CLOSE_RANGE_CLOEXEC)
|
||||
err := unix.CloseRange(uint(minFd), math.MaxInt32, unix.CLOSE_RANGE_CLOEXEC)
|
||||
return os.NewSyscallError("close_range", err)
|
||||
}
|
||||
// Otherwise, fall back to the standard loop.
|
||||
|
Reference in New Issue
Block a user