Correct intuition for setupDev

Minor fix, the former setupDev=true means not setup dev,
which is contrary to intuition, just correct it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang 2015-10-21 16:06:26 +08:00
parent 3be7f87b1b
commit 34cff6f2f3
1 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ func setupRootfs(config *configs.Config, console *linuxConsole) (err error) {
return newSystemError(err)
}
setupDev := len(config.Devices) == 0
setupDev := len(config.Devices) != 0
for _, m := range config.Mounts {
for _, precmd := range m.PremountCmds {
if err := mountCmd(precmd); err != nil {
@ -46,7 +46,7 @@ func setupRootfs(config *configs.Config, console *linuxConsole) (err error) {
}
}
}
if !setupDev {
if setupDev {
if err := createDevices(config); err != nil {
return newSystemError(err)
}
@ -68,7 +68,7 @@ func setupRootfs(config *configs.Config, console *linuxConsole) (err error) {
if err != nil {
return newSystemError(err)
}
if !setupDev {
if setupDev {
if err := reOpenDevNull(); err != nil {
return newSystemError(err)
}