Browse code

Merge pull request #17628 from LK4D4/umount_log_err

Log error from unmountVolumes on cleanup

David Calavera authored on 2015/11/03 08:38:32
Showing 3 changed files
... ...
@@ -347,7 +347,9 @@ func (container *Container) cleanup() {
347 347
 		container.daemon.unregisterExecCommand(eConfig)
348 348
 	}
349 349
 
350
-	container.unmountVolumes(false)
350
+	if err := container.unmountVolumes(false); err != nil {
351
+		logrus.Warnf("%s cleanup: Failed to umount volumes: %v", container.ID, err)
352
+	}
351 353
 }
352 354
 
353 355
 // killSig sends the container the given signal. This wrapper for the
... ...
@@ -6,6 +6,6 @@ import "syscall"
6 6
 
7 7
 // Unmount is a platform-specific helper function to call
8 8
 // the unmount syscall.
9
-func Unmount(dest string) {
10
-	syscall.Unmount(dest, 0)
9
+func Unmount(dest string) error {
10
+	return syscall.Unmount(dest, 0)
11 11
 }
... ...
@@ -2,5 +2,6 @@ package system
2 2
 
3 3
 // Unmount is a platform-specific helper function to call
4 4
 // the unmount syscall. Not supported on Windows
5
-func Unmount(dest string) {
5
+func Unmount(dest string) error {
6
+	return nil
6 7
 }