main: don't attempt lazy unmount on MacOSX
This commit is contained in:
parent
6ac9dcaae0
commit
bef27305bc
14
mount.go
14
mount.go
@ -9,6 +9,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
@ -291,11 +292,14 @@ func handleSigint(srv *fuse.Server, mountpoint string) {
|
|||||||
err := srv.Unmount()
|
err := srv.Unmount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tlog.Warn.Print(err)
|
tlog.Warn.Print(err)
|
||||||
tlog.Info.Printf("Trying lazy unmount")
|
if runtime.GOOS == "linux" {
|
||||||
cmd := exec.Command("fusermount", "-u", "-z", mountpoint)
|
// MacOSX does not support lazy unmount
|
||||||
cmd.Stdout = os.Stdout
|
tlog.Info.Printf("Trying lazy unmount")
|
||||||
cmd.Stderr = os.Stderr
|
cmd := exec.Command("fusermount", "-u", "-z", mountpoint)
|
||||||
cmd.Run()
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
cmd.Run()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}()
|
}()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user