Don't treat runtime error as shim error

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-03-17 16:32:35 -07:00
parent 5617360b3a
commit 0969765fad
2 changed files with 13 additions and 0 deletions

View file

@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@ -16,6 +17,8 @@ import (
"github.com/opencontainers/runc/libcontainer"
)
var errRuntime = errors.New("shim: runtime execution error")
type process struct {
sync.WaitGroup
id string
@ -144,6 +147,9 @@ func (p *process) start() error {
p.stdio.stdout.Close()
p.stdio.stderr.Close()
if err := cmd.Wait(); err != nil {
if _, ok := err.(*exec.ExitError); ok {
return errRuntime
}
return err
}
data, err := ioutil.ReadFile("pid")