From ecd555de4e69183f8484f30a431bcfcb09591799 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 13 Mar 2014 14:31:09 -0700 Subject: [PATCH] Always symlink /dev/ptmx for libcontainer Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- nsinit/mount.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nsinit/mount.go b/nsinit/mount.go index 83577cfa..072188ec 100644 --- a/nsinit/mount.go +++ b/nsinit/mount.go @@ -46,10 +46,8 @@ func setupNewMountNamespace(rootfs, console string, readonly, noPivotRoot bool) if err := setupDev(rootfs); err != nil { return err } - if console != "" { - if err := setupPtmx(rootfs, console); err != nil { - return err - } + if err := setupPtmx(rootfs, console); err != nil { + return err } if err := system.Chdir(rootfs); err != nil { return fmt.Errorf("chdir into %s %s", rootfs, err) @@ -245,8 +243,10 @@ func setupPtmx(rootfs, console string) error { if err := os.Symlink("pts/ptmx", ptmx); err != nil { return fmt.Errorf("symlink dev ptmx %s", err) } - if err := setupConsole(rootfs, console); err != nil { - return err + if console != "" { + if err := setupConsole(rootfs, console); err != nil { + return err + } } return nil }