mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
applehv: Remove unneeded cmd.ExtraFiles assignment
`applehv.Start()` has this line of code: ``` cmd.ExtraFiles = []*os.File{ioEater, ioEater, ioEater} ``` whose purpose is not clear. The intent may have been to redirect stdin/stdout/stderr to /dev/null in the child process. This should be done by setting cmd.Stdin/cmd.Stdout/cmd/Stderr to nil, which is the case by default. The way it's done could also cause issues as `Vfkit.VirtualMachine.Cmd()` sometimes adds files it needs to keep open to `ExtraFiles`, so at the very least this should be an `append()` This commit removes this code. [NO NEW TESTS NEEDED] Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
@ -572,12 +572,6 @@ func (m *MacMachine) Start(name string, opts machine.StartOptions) error {
|
|||||||
return machine.ErrVMAlreadyRunning
|
return machine.ErrVMAlreadyRunning
|
||||||
}
|
}
|
||||||
|
|
||||||
ioEater, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0755)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer ioEater.Close()
|
|
||||||
|
|
||||||
// TODO handle returns from startHostNetworking
|
// TODO handle returns from startHostNetworking
|
||||||
forwardSock, forwardState, err := m.startHostNetworking()
|
forwardSock, forwardState, err := m.startHostNetworking()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -641,8 +635,6 @@ func (m *MacMachine) Start(name string, opts machine.StartOptions) error {
|
|||||||
cmd.Args = append(cmd.Args, "--gui") // add command line switch to pop the gui open
|
cmd.Args = append(cmd.Args, "--gui") // add command line switch to pop the gui open
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.ExtraFiles = []*os.File{ioEater, ioEater, ioEater}
|
|
||||||
|
|
||||||
readSocketBaseDir := filepath.Dir(m.ReadySocket.GetPath())
|
readSocketBaseDir := filepath.Dir(m.ReadySocket.GetPath())
|
||||||
if err := os.MkdirAll(readSocketBaseDir, 0755); err != nil {
|
if err := os.MkdirAll(readSocketBaseDir, 0755); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user