From 998dba34b80b5dde2991cd86d422a2adcf329b8d Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 9 Apr 2014 01:17:53 +1000 Subject: [PATCH] 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. --- cmd/torrentfs/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) + } + } }() } -- 2.48.1