OSX compilation

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@dotcloud.com> (github: creack)
Upstream-commit: f3c48ec584707a9acaf9d79c2e161dadf1d2c99b
Component: engine
This commit is contained in:
Guillaume J. Charmes
2014-02-21 14:56:16 -08:00
committed by Michael Crosby
parent 3c99ad7033
commit 92c44382e1
4 changed files with 19 additions and 0 deletions
@@ -1,3 +1,5 @@
// +build linux
package main
import (
@@ -1,3 +1,5 @@
// +build linux
package main
import (
@@ -2,17 +2,27 @@ package main
import (
"encoding/json"
"errors"
"github.com/dotcloud/docker/pkg/libcontainer"
"log"
"os"
)
var (
ErrUnsupported = errors.New("Unsupported method")
ErrWrongArguments = errors.New("Wrong argument count")
)
func main() {
container, err := loadContainer()
if err != nil {
log.Fatal(err)
}
argc := len(os.Args)
if argc < 2 {
log.Fatal(ErrWrongArguments)
}
switch os.Args[1] {
case "exec":
exitCode, err := execCommand(container)
@@ -21,6 +31,9 @@ func main() {
}
os.Exit(exitCode)
case "init":
if argc != 3 {
log.Fatal(ErrWrongArguments)
}
if err := initCommand(container, os.Args[2]); err != nil {
log.Fatal(err)
}
@@ -1,3 +1,5 @@
// +build linux
package main
import (