mirror of
https://github.com/containers/podman.git
synced 2025-10-25 02:04:43 +08:00
Merge pull request #16512 from dfr/freebsd-preserve-fds
Add support for --preserve-fds on FreeBSD for run and exec
This commit is contained in:
@ -870,7 +870,7 @@ func makeExecConfig(options entities.ExecOptions, rt *libpod.Runtime) (*libpod.E
|
||||
|
||||
func checkExecPreserveFDs(options entities.ExecOptions) error {
|
||||
if options.PreserveFDs > 0 {
|
||||
entries, err := os.ReadDir("/proc/self/fd")
|
||||
entries, err := os.ReadDir(processFileDescriptorsPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -879,7 +879,7 @@ func checkExecPreserveFDs(options entities.ExecOptions) error {
|
||||
for _, e := range entries {
|
||||
i, err := strconv.Atoi(e.Name())
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot parse %s in /proc/self/fd: %w", e.Name(), err)
|
||||
return fmt.Errorf("cannot parse %s in %s: %w", e.Name(), processFileDescriptorsPath, err)
|
||||
}
|
||||
m[i] = true
|
||||
}
|
||||
|
||||
3
pkg/domain/infra/abi/containers_freebsd.go
Normal file
3
pkg/domain/infra/abi/containers_freebsd.go
Normal file
@ -0,0 +1,3 @@
|
||||
package abi
|
||||
|
||||
const processFileDescriptorsPath = "/dev/fd"
|
||||
3
pkg/domain/infra/abi/containers_linux.go
Normal file
3
pkg/domain/infra/abi/containers_linux.go
Normal file
@ -0,0 +1,3 @@
|
||||
package abi
|
||||
|
||||
const processFileDescriptorsPath = "/proc/self/fd"
|
||||
Reference in New Issue
Block a user