Fixed unmount_linux.go.

geesefs-0-30-9
Aaron Jacobs 2015-07-24 16:21:58 +10:00
parent c7757fe840
commit c7738d6ded
1 changed files with 8 additions and 6 deletions

View File

@ -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
}