mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Revert "Return proper exit code for exec errors"
This reverts commit 6bb653a6e8.
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
@@ -27,25 +24,8 @@ func init() {
|
||||
logrus.Fatalf("unable to initialize for container: %s", err)
|
||||
}
|
||||
if err := factory.StartInitialization(); err != nil {
|
||||
// return proper unix error codes
|
||||
if exerr, ok := err.(*exec.Error); ok {
|
||||
switch exerr.Err {
|
||||
case os.ErrPermission:
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(126)
|
||||
case exec.ErrNotFound:
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(127)
|
||||
default:
|
||||
if os.IsNotExist(exerr.Err) {
|
||||
fmt.Fprintf(os.Stderr, "exec: %s: %v\n", strconv.Quote(exerr.Name), os.ErrNotExist)
|
||||
os.Exit(127)
|
||||
}
|
||||
}
|
||||
}
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
panic("init: init failed to start contianer")
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user