Close stdin after data has been copied
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
5faf2bd102
commit
ae5c752449
2 changed files with 6 additions and 1 deletions
|
@ -131,6 +131,7 @@ var StartCommand = cli.Command{
|
|||
if state != nil {
|
||||
term.RestoreTerminal(os.Stdin.Fd(), state)
|
||||
}
|
||||
stdin.Close()
|
||||
}()
|
||||
for {
|
||||
e, err := events.Recv()
|
||||
|
@ -335,6 +336,7 @@ var ExecCommand = cli.Command{
|
|||
if state != nil {
|
||||
term.RestoreTerminal(os.Stdin.Fd(), state)
|
||||
}
|
||||
stdin.Close()
|
||||
}()
|
||||
for {
|
||||
e, err := events.Recv()
|
||||
|
|
5
io.go
5
io.go
|
@ -25,7 +25,10 @@ func newCopier(i *ioConfig) (*copier, error) {
|
|||
return nil, err
|
||||
}
|
||||
l.closers = append(l.closers, f)
|
||||
go io.Copy(i.Stdin, f)
|
||||
go func() {
|
||||
io.Copy(i.Stdin, f)
|
||||
i.Stdin.Close()
|
||||
}()
|
||||
}
|
||||
if i.StdoutPath != "" {
|
||||
f, err := os.OpenFile(i.StdoutPath, os.O_RDWR, 0)
|
||||
|
|
Loading…
Reference in a new issue