Fix panic on starting exec more than once

Issue was caused when exec is tarted, exits, then stated again.
In this case, `Close` is called twice, which closes a channel twice.

Changes execConfig.ExitCode to a pointer so we can test if the it has
been set or not.
This allows us to return early when the exec has already been run.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 1a60a805bfabee729dbc833515cd0be439adb95b
Component: engine
This commit is contained in:
Brian Goff
2016-01-15 11:57:23 -05:00
parent 89c24617af
commit addf165927
4 changed files with 65 additions and 17 deletions

View File

@ -18,7 +18,7 @@ type Config struct {
*runconfig.StreamConfig
ID string
Running bool
ExitCode int
ExitCode *int
ProcessConfig *execdriver.ProcessConfig
OpenStdin bool
OpenStderr bool