aboutsummaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-02-15 23:20:41 +0100
committerJakob Unterwurzacher2017-02-15 23:20:41 +0100
commitbef27305bca2638ec017cc1d9ec1a1e250dd33a3 (patch)
treef8de25bc12b2c0fa5fca1c83428f8afff7df67ed /mount.go
parent6ac9dcaae0ab57f738c25a7fa5c505b6d1b8aeda (diff)
main: don't attempt lazy unmount on MacOSX
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/mount.go b/mount.go
index 032589d..9e66a94 100644
--- a/mount.go
+++ b/mount.go
@@ -9,6 +9,7 @@ import (
"os/exec"
"os/signal"
"path/filepath"
+ "runtime"
"strings"
"syscall"
"time"
@@ -291,11 +292,14 @@ func handleSigint(srv *fuse.Server, mountpoint string) {
err := srv.Unmount()
if err != nil {
tlog.Warn.Print(err)
- tlog.Info.Printf("Trying lazy unmount")
- cmd := exec.Command("fusermount", "-u", "-z", mountpoint)
- cmd.Stdout = os.Stdout
- cmd.Stderr = os.Stderr
- cmd.Run()
+ if runtime.GOOS == "linux" {
+ // MacOSX does not support lazy unmount
+ tlog.Info.Printf("Trying lazy unmount")
+ cmd := exec.Command("fusermount", "-u", "-z", mountpoint)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ cmd.Run()
+ }
}
os.Exit(1)
}()