mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
list, utils: remove redundant code
The value of root is already an absolute path since commit
ede8a86ec1, so it does not make sense to call filepath.Abs()
again.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
+1
-6
@@ -26,12 +26,7 @@ var errEmptyID = errors.New("container id cannot be empty")
|
||||
// loadFactory returns the configured factory instance for execing containers.
|
||||
func loadFactory(context *cli.Context) (libcontainer.Factory, error) {
|
||||
root := context.GlobalString("root")
|
||||
abs, err := filepath.Abs(root)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return libcontainer.New(abs)
|
||||
return libcontainer.New(root)
|
||||
}
|
||||
|
||||
// getContainer returns the specified container instance by loading it from state
|
||||
|
||||
Reference in New Issue
Block a user