Merge pull request #494 from crosbymichael/cwd

Only set cwd when not empty
This commit is contained in:
Qiang Huang 2016-01-22 09:50:38 +08:00
commit 4e6893b05a
1 changed files with 4 additions and 2 deletions

View File

@ -134,8 +134,10 @@ func finalizeNamespace(config *initConfig) error {
if err := w.drop(); err != nil {
return err
}
if err := syscall.Chdir(config.Cwd); err != nil {
return err
if config.Cwd != "" {
if err := syscall.Chdir(config.Cwd); err != nil {
return err
}
}
return nil
}