Only set cwd when not empty
For existing consumers of libconatiner to not require cwd inside the libcontainer code. This can be done at the runc level and is already evaluated there. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
986637c97a
commit
ed7be1d082
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue