From a20fea1823ccfb40d235607e8f7ce7ceff1b5afe Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 2 Nov 2015 13:18:07 -0800 Subject: [PATCH] Log error from unmountVolumes on cleanup Signed-off-by: Alexander Morozov --- daemon/container.go | 4 +++- pkg/system/syscall_unix.go | 4 ++-- pkg/system/syscall_windows.go | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index f6250d37d9..b413173818 100644 --- a/daemon/container.go +++ b/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 diff --git a/pkg/system/syscall_unix.go b/pkg/system/syscall_unix.go index 50054765af..f1497c587e 100644 --- a/pkg/system/syscall_unix.go +++ b/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) } diff --git a/pkg/system/syscall_windows.go b/pkg/system/syscall_windows.go index 3a3a55b266..b3b94cb5eb 100644 --- a/pkg/system/syscall_windows.go +++ b/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 }