|
@@ -174,8 +174,8 @@ func (container *Container) HasMountFor(path string) bool {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
-// UnmountIpcMount uses the provided unmount function to unmount shm if it was mounted
|
|
|
-func (container *Container) UnmountIpcMount(unmount func(pth string) error) error {
|
|
|
+// UnmountIpcMount unmounts shm if it was mounted
|
|
|
+func (container *Container) UnmountIpcMount() error {
|
|
|
if container.HasMountFor("/dev/shm") {
|
|
|
return nil
|
|
|
}
|
|
@@ -189,10 +189,8 @@ func (container *Container) UnmountIpcMount(unmount func(pth string) error) erro
|
|
|
if shmPath == "" {
|
|
|
return nil
|
|
|
}
|
|
|
- if err = unmount(shmPath); err != nil && !os.IsNotExist(err) {
|
|
|
- if mounted, mErr := mount.Mounted(shmPath); mounted || mErr != nil {
|
|
|
- return errors.Wrapf(err, "umount %s", shmPath)
|
|
|
- }
|
|
|
+ if err = mount.Unmount(shmPath); err != nil && !os.IsNotExist(err) {
|
|
|
+ return errors.Wrapf(err, "umount %s", shmPath)
|
|
|
}
|
|
|
return nil
|
|
|
}
|