Update windows locking code

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-08-01 10:07:25 -04:00
parent d18af8699c
commit f945cdc704
2 changed files with 13 additions and 10 deletions

View File

@@ -89,6 +89,13 @@ func (p *process) ExitCode() (uint32, time.Time, error) {
}
func (p *process) Start(ctx context.Context) (err error) {
// If we fail, close the io right now
defer func() {
if err != nil {
p.io.Close()
}
}()
var hp hcsshim.Process
if hp, err = p.task.hcsContainer.CreateProcess(p.conf); err != nil {
return errors.Wrapf(err, "failed to create process")