diff --git a/unmount_linux.go b/unmount_linux.go index 6a165cc..86abc8d 100644 --- a/unmount_linux.go +++ b/unmount_linux.go @@ -2,20 +2,22 @@ package fuseshim import ( "bytes" - "errors" + "fmt" "os/exec" ) -func unmount(dir string) error { +func unmount(dir string) (err error) { + // Call fusermount. cmd := exec.Command("fusermount", "-u", dir) output, err := cmd.CombinedOutput() if err != nil { if len(output) > 0 { output = bytes.TrimRight(output, "\n") - msg := err.Error() + ": " + string(output) - err = errors.New(msg) + err = fmt.Errorf("%v: %s", err, output) } - return err + + return } - return nil + + return }