From 029923329da27791566e6c5b13a013b015dda252 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 13 May 2014 11:32:10 -0700 Subject: [PATCH] add os.Kill signal to handle. go fmt some code. --- go/filer/client_operations.go | 1 - go/weed/mount.go | 3 +-- go/weed/mount_std.go | 2 +- go/weed/server.go | 2 +- go/weed/volume.go | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go/filer/client_operations.go b/go/filer/client_operations.go index 2eb5c399d..b8a4dca53 100644 --- a/go/filer/client_operations.go +++ b/go/filer/client_operations.go @@ -68,4 +68,3 @@ func call(server string, request ApiRequest, ret interface{}) error { } return nil } - diff --git a/go/weed/mount.go b/go/weed/mount.go index 23f85f567..0290e0f53 100644 --- a/go/weed/mount.go +++ b/go/weed/mount.go @@ -1,7 +1,6 @@ package main -import ( -) +import () type MountOptions struct { filer *string diff --git a/go/weed/mount_std.go b/go/weed/mount_std.go index 5d01a0f87..35ca4011d 100644 --- a/go/weed/mount_std.go +++ b/go/weed/mount_std.go @@ -29,7 +29,7 @@ func runMount(cmd *Command, args []string) bool { } signalChan := make(chan os.Signal, 1) - signal.Notify(signalChan, os.Interrupt) + signal.Notify(signalChan, os.Interrupt, os.Kill) go func() { for _ = range signalChan { // sig is a ^C, handle it diff --git a/go/weed/server.go b/go/weed/server.go index a62291bd0..7684dcbde 100644 --- a/go/weed/server.go +++ b/go/weed/server.go @@ -220,7 +220,7 @@ func runServer(cmd *Command, args []string) bool { // deal with control+c signalChan := make(chan os.Signal, 1) - signal.Notify(signalChan, os.Interrupt) + signal.Notify(signalChan, os.Interrupt, os.Kill) go func() { for _ = range signalChan { volumeServer.Shutdown() diff --git a/go/weed/volume.go b/go/weed/volume.go index 1885afd79..5afa8eea5 100644 --- a/go/weed/volume.go +++ b/go/weed/volume.go @@ -94,7 +94,7 @@ func runVolume(cmd *Command, args []string) bool { // deal with control+c signalChan := make(chan os.Signal, 1) - signal.Notify(signalChan, os.Interrupt) + signal.Notify(signalChan, os.Interrupt, os.Kill) go func() { for _ = range signalChan { volumeServer.Shutdown()