Browse Source

Log error from unmountVolumes on cleanup

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Alexander Morozov 9 years ago
parent
commit
a20fea1823
3 changed files with 7 additions and 4 deletions
  1. 3 1
      daemon/container.go
  2. 2 2
      pkg/system/syscall_unix.go
  3. 2 1
      pkg/system/syscall_windows.go

+ 3 - 1
daemon/container.go

@@ -349,7 +349,9 @@ func (container *Container) cleanup() {
 		container.daemon.unregisterExecCommand(eConfig)
 	}
 
-	container.unmountVolumes(false)
+	if err := container.unmountVolumes(false); err != nil {
+		logrus.Warnf("%s cleanup: Failed to umount volumes: %v", container.ID, err)
+	}
 }
 
 // killSig sends the container the given signal. This wrapper for the

+ 2 - 2
pkg/system/syscall_unix.go

@@ -6,6 +6,6 @@ import "syscall"
 
 // Unmount is a platform-specific helper function to call
 // the unmount syscall.
-func Unmount(dest string) {
-	syscall.Unmount(dest, 0)
+func Unmount(dest string) error {
+	return syscall.Unmount(dest, 0)
 }

+ 2 - 1
pkg/system/syscall_windows.go

@@ -2,5 +2,6 @@ package system
 
 // Unmount is a platform-specific helper function to call
 // the unmount syscall. Not supported on Windows
-func Unmount(dest string) {
+func Unmount(dest string) error {
+	return nil
 }