|
@@ -2,7 +2,6 @@ package native
|
|
|
|
|
|
import (
|
|
import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
- "errors"
|
|
|
|
"fmt"
|
|
"fmt"
|
|
"github.com/dotcloud/docker/execdriver"
|
|
"github.com/dotcloud/docker/execdriver"
|
|
"github.com/dotcloud/docker/pkg/cgroups"
|
|
"github.com/dotcloud/docker/pkg/cgroups"
|
|
@@ -22,10 +21,6 @@ const (
|
|
Version = "0.1"
|
|
Version = "0.1"
|
|
)
|
|
)
|
|
|
|
|
|
-var (
|
|
|
|
- ErrNotSupported = errors.New("not supported")
|
|
|
|
-)
|
|
|
|
-
|
|
|
|
func init() {
|
|
func init() {
|
|
execdriver.RegisterInitFunc(DriverName, func(args *execdriver.InitArgs) error {
|
|
execdriver.RegisterInitFunc(DriverName, func(args *execdriver.InitArgs) error {
|
|
var (
|
|
var (
|
|
@@ -109,10 +104,13 @@ func (d *driver) Restore(c *execdriver.Command) error {
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
- defer f.Close()
|
|
|
|
if _, err := fmt.Fscanf(f, "%d", &nspid); err != nil {
|
|
if _, err := fmt.Fscanf(f, "%d", &nspid); err != nil {
|
|
|
|
+ f.Close()
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
+ f.Close()
|
|
|
|
+ defer os.Remove(p)
|
|
|
|
+
|
|
proc, err := os.FindProcess(nspid)
|
|
proc, err := os.FindProcess(nspid)
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|