diff --git a/config.go b/config.go index fed4636..614b026 100644 --- a/config.go +++ b/config.go @@ -298,6 +298,7 @@ func parseConfig() { errChan <- fmt.Errorf("mainMouseClick() got b = nil") errChan <- "hello" + handleSignal(nil, 0) // my pid (cross platform) p, err := os.FindProcess(os.Getpid()) // send signal (cross platform) return p.Signal(syscall.SIGTERM) diff --git a/linux.go b/linux.go index d07fe5d..4bc4e10 100644 --- a/linux.go +++ b/linux.go @@ -1,5 +1,7 @@ // +build linux,go1.7 +// put stuff in here that you only want compiled under linux + package main import "log" @@ -14,8 +16,8 @@ import "syscall" // import "git.wit.com/wit/shell" // import "github.com/davecgh/go-spew/spew" -func handleLinux(err interface{}, ret int) { +func handleSignal(err interface{}, ret int) { + log.Println("handleSignal() only should be compiled on linux") sigChan = make(chan os.Signal, 3) - log.Println("handleLinux() only should be compiled on linux") signal.Notify(sigChan, syscall.SIGUSR1) } diff --git a/windows.go b/windows.go new file mode 100644 index 0000000..424fd08 --- /dev/null +++ b/windows.go @@ -0,0 +1,21 @@ +// +build windows + +// put stuff in here that you only want compiled under windows + +package main + +import "log" +import "os" +import "os/signal" +import "syscall" + +// import "runtime" +// import "time" +// import "reflect" + +// import "git.wit.com/wit/shell" +// import "github.com/davecgh/go-spew/spew" + +func handleSignal(err interface{}, ret int) { + log.Println("handleSignal() windows doesn't do signals") +}