mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
only use stdin if specified
Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
@ -1057,12 +1057,8 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal
|
|||||||
ecChan := make(chan int, 1)
|
ecChan := make(chan int, 1)
|
||||||
errChan := configureVarlinkAttachStdio(r.Conn.Reader, r.Conn.Writer, inputStream, os.Stdout, oldTermState, resize, ecChan)
|
errChan := configureVarlinkAttachStdio(r.Conn.Reader, r.Conn.Writer, inputStream, os.Stdout, oldTermState, resize, ecChan)
|
||||||
|
|
||||||
select {
|
ec = <-ecChan
|
||||||
case ec = <-ecChan:
|
err = <-errChan
|
||||||
break
|
|
||||||
case err = <-errChan:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
return ec, err
|
return ec, err
|
||||||
}
|
}
|
||||||
@ -1095,6 +1091,7 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if stdin != nil {
|
||||||
// Takes stdinput and sends it over the wire after being encoded
|
// Takes stdinput and sends it over the wire after being encoded
|
||||||
go func() {
|
go func() {
|
||||||
if _, err := io.Copy(varlinkStdinWriter, stdin); err != nil {
|
if _, err := io.Copy(varlinkStdinWriter, stdin); err != nil {
|
||||||
@ -1103,5 +1100,6 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std
|
|||||||
}
|
}
|
||||||
|
|
||||||
}()
|
}()
|
||||||
|
}
|
||||||
return errChan
|
return errChan
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user