remove redundant the parameter of chroot function
Signed-off-by: Xiaodong Liu <liuxiaodong@loongson.cn>
This commit is contained in:
parent
b7d8f3bf0d
commit
af283b3f47
|
@ -110,7 +110,7 @@ func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig) (err error) {
|
||||||
} else if config.Namespaces.Contains(configs.NEWNS) {
|
} else if config.Namespaces.Contains(configs.NEWNS) {
|
||||||
err = pivotRoot(config.Rootfs)
|
err = pivotRoot(config.Rootfs)
|
||||||
} else {
|
} else {
|
||||||
err = chroot(config.Rootfs)
|
err = chroot()
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return newSystemErrorWithCause(err, "jailing process inside rootfs")
|
return newSystemErrorWithCause(err, "jailing process inside rootfs")
|
||||||
|
@ -836,10 +836,10 @@ func msMoveRoot(rootfs string) error {
|
||||||
if err := unix.Mount(rootfs, "/", "", unix.MS_MOVE, ""); err != nil {
|
if err := unix.Mount(rootfs, "/", "", unix.MS_MOVE, ""); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return chroot(rootfs)
|
return chroot()
|
||||||
}
|
}
|
||||||
|
|
||||||
func chroot(rootfs string) error {
|
func chroot() error {
|
||||||
if err := unix.Chroot("."); err != nil {
|
if err := unix.Chroot("."); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue