Merge pull request #865 from mlaventure/close-stdin-pipe-if-not-requested

Close stdin on create if it wasn't requested and there's no terminal
This commit is contained in:
Michael Crosby 2017-05-16 15:05:15 -07:00 committed by GitHub
commit ce0c802bae

View File

@ -83,6 +83,7 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w
dest(fw, fr) dest(fw, fr)
} }
if stdin == "" { if stdin == "" {
rio.Stdin().Close()
return nil return nil
} }
f, err := fifo.OpenFifo(ctx, stdin, syscall.O_RDONLY, 0) f, err := fifo.OpenFifo(ctx, stdin, syscall.O_RDONLY, 0)