mount.isFUSE(): remove unused error return

The error itself was unused, so may as well remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-09-28 13:07:56 +02:00
parent 4a6b47d470
commit 5b13dcc73a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -106,20 +106,20 @@ func Unmount(target string, flags int) error {
return nil return nil
} }
func isFUSE(dir string) (bool, error) { func isFUSE(dir string) bool {
// fuseSuperMagic is defined in statfs(2) // fuseSuperMagic is defined in statfs(2)
const fuseSuperMagic = 0x65735546 const fuseSuperMagic = 0x65735546
var st unix.Statfs_t var st unix.Statfs_t
if err := unix.Statfs(dir, &st); err != nil { if err := unix.Statfs(dir, &st); err != nil {
return false, err return false
} }
return st.Type == fuseSuperMagic, nil return st.Type == fuseSuperMagic
} }
func unmount(target string, flags int) error { func unmount(target string, flags int) error {
// For FUSE mounts, attempting to execute fusermount helper binary is preferred // For FUSE mounts, attempting to execute fusermount helper binary is preferred
// https://github.com/containerd/containerd/pull/3765#discussion_r342083514 // https://github.com/containerd/containerd/pull/3765#discussion_r342083514
if ok, err := isFUSE(target); err == nil && ok { if isFUSE(target) {
for _, helperBinary := range []string{"fusermount3", "fusermount"} { for _, helperBinary := range []string{"fusermount3", "fusermount"} {
cmd := exec.Command(helperBinary, "-u", target) cmd := exec.Command(helperBinary, "-u", target)
if err := cmd.Run(); err == nil { if err := cmd.Run(); err == nil {