From 2ef56b2ee81967cce5bd7c78e2ccc8134753e3dc Mon Sep 17 00:00:00 2001 From: Harry Zhang Date: Tue, 28 Jun 2016 03:04:38 -0400 Subject: [PATCH] Fix fd leak Signed-off-by: Harry Zhang Signed-off-by: Harry Zhang --- runtime/process.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/process.go b/runtime/process.go index ce7a1c3..1564b6e 100644 --- a/runtime/process.go +++ b/runtime/process.go @@ -201,7 +201,11 @@ func (p *process) Stdio() Stdio { // Close closes any open files and/or resouces on the process func (p *process) Close() error { - return p.exitPipe.Close() + err := p.exitPipe.Close() + if cerr := p.controlPipe.Close(); err == nil { + err = cerr + } + return err } func (p *process) State() State {