Fix fd leak

Signed-off-by: Harry Zhang <harryzhang@zju.edu.cn>
Signed-off-by: Harry Zhang <harryz@hyper.sh>
This commit is contained in:
Harry Zhang 2016-06-28 03:04:38 -04:00 committed by Harry Zhang
parent a8c73b6959
commit 2ef56b2ee8

View file

@ -201,7 +201,11 @@ func (p *process) Stdio() Stdio {
// Close closes any open files and/or resouces on the process // Close closes any open files and/or resouces on the process
func (p *process) Close() error { 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 { func (p *process) State() State {