Close stdin on create if it wasn't requested and there's no terminal

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-05-16 14:10:06 -07:00
parent 6a7aea6fb1
commit 5523936cf5

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)