Wait on exec process not task

Fixes #1449

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-09-01 11:50:39 -04:00
parent 3e2a9c60af
commit 5614e9c7b3

View File

@ -70,7 +70,7 @@ var taskExecCommand = cli.Command{
}
defer process.Delete(ctx)
statusC, err := task.Wait(ctx)
statusC, err := process.Wait(ctx)
if err != nil {
return err
}
@ -83,9 +83,6 @@ var taskExecCommand = cli.Command{
return err
}
}
if err := process.Start(ctx); err != nil {
return err
}
if tty {
if err := handleConsoleResize(ctx, process, con); err != nil {
logrus.WithError(err).Error("console resize")
@ -94,6 +91,10 @@ var taskExecCommand = cli.Command{
sigc := forwardAllSignals(ctx, process)
defer stopCatch(sigc)
}
if err := process.Start(ctx); err != nil {
return err
}
status := <-statusC
code, _, err := status.Result()
if err != nil {