Commit 9ce778ed authored by Alex Fishman's avatar Alex Fishman Committed by Han-Wen Nienhuys

Add ctrl-c signal handler to loopback for graceful unmount

Signed-off-by: default avatarAlex Fishman <alex@fuse-t.org>
Change-Id: I82de5e2dd0340da4e05e4ccf1bbd162dff33b656
parent 166da21e
...@@ -127,5 +127,13 @@ func main() { ...@@ -127,5 +127,13 @@ func main() {
if !*quiet { if !*quiet {
fmt.Println("Mounted!") fmt.Println("Mounted!")
} }
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c
server.Unmount()
}()
server.Wait() server.Wait()
} }
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