From 761184df5295b72c5d1ab4549dcddb54977da487 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 10 Dec 2013 12:49:53 -0600 Subject: [PATCH] don't open bind mounted files/dirs to get Stat, use os.Lstat --- container.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/container.go b/container.go index bb0723eada..36330909ce 100644 --- a/container.go +++ b/container.go @@ -801,15 +801,10 @@ func (container *Container) createVolumes() error { if strings.ToLower(bindMap.Mode) == "rw" { srcRW = true } - if file, err := os.Open(bindMap.SrcPath); err != nil { + if stat, err := os.Lstat(bindMap.SrcPath); err != nil { return err } else { - defer file.Close() - if stat, err := file.Stat(); err != nil { - return err - } else { - volIsDir = stat.IsDir() - } + volIsDir = stat.IsDir() } // Otherwise create an directory in $ROOT/volumes/ and use that } else {