From: Matt Joiner Date: Tue, 8 Apr 2014 15:17:53 +0000 (+1000) Subject: Handle repeat SIGINT/SIGTERMs X-Git-Tag: v1.0.0~1756 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=998dba34b80b5dde2991cd86d422a2adcf329b8d;p=btrtrc.git Handle repeat SIGINT/SIGTERMs Need to determine if there's a way to better interrupt the FS or if we have no control over that. --- diff --git a/cmd/torrentfs/main.go b/cmd/torrentfs/main.go index 694c8938..b55a7a08 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -57,8 +57,13 @@ func setSignalHandlers() { c := make(chan os.Signal) signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) go func() { - <-c - fuse.Unmount(mountDir) + for { + <-c + err := fuse.Unmount(mountDir) + if err != nil { + log.Print(err) + } + } }() }