summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-03-27 10:07:06 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-27 14:46:17 +0000
commit26d7e3c7b85e28c4e42998c90fdcc14079f13eef (patch)
treeb5f29ad6e00b832bb13b072e11db6ba5187601c8 /libpod/container.go
parent304bf53c28301a8dfd126f2304e02df5472e56b1 (diff)
downloadpodman-26d7e3c7b85e28c4e42998c90fdcc14079f13eef.tar.gz
podman-26d7e3c7b85e28c4e42998c90fdcc14079f13eef.tar.bz2
podman-26d7e3c7b85e28c4e42998c90fdcc14079f13eef.zip
Fix some minor issues lint has been picking up
Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #556 Approved by: baude
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 98810ea94..c2b07eb3f 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -743,10 +743,12 @@ func (c *Container) BindMounts() (map[string]string, error) {
// NamespacePath returns the path of one of the container's namespaces
// If the container is not running, an error will be returned
func (c *Container) NamespacePath(ns LinuxNS) (string, error) {
- c.lock.Lock()
- defer c.lock.Unlock()
- if err := c.syncContainer(); err != nil {
- return "", errors.Wrapf(err, "error updating container %s state", c.ID())
+ if !c.locked {
+ c.lock.Lock()
+ defer c.lock.Unlock()
+ if err := c.syncContainer(); err != nil {
+ return "", errors.Wrapf(err, "error updating container %s state", c.ID())
+ }
}
if c.state.State != ContainerStateRunning && c.state.State != ContainerStatePaused {