Commit 956202f0 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: use Unmount syscall on darwin directly.

parent 829ecdd2
......@@ -110,6 +110,7 @@ import (
"os"
"os/exec"
"path/filepath"
"syscall"
"unsafe"
)
......@@ -133,18 +134,10 @@ func (m mountError) Error() string {
}
func unmount(mountPoint string) error {
dir, _ := filepath.Split(mountPoint)
proc, err := os.StartProcess(umountBinary,
[]string{umountBinary, mountPoint},
&os.ProcAttr{Dir: dir, Files: []*os.File{nil, nil, os.Stderr}})
if err != nil {
return err
}
w, err := proc.Wait()
if !w.Success() {
return fmt.Errorf("umount exited with code %v\n", w.Sys())
if err := syscall.Unmount(mountPoint, 0); err != nil {
return fmt.Errorf("umount(%q): %v", mountPoint, err)
}
return err
return nil
}
var umountBinary string
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment