this is how you solve the linux vs windows compile solution
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
a6b312d6a3
commit
7706146f17
|
@ -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)
|
||||
|
||||
|
|
6
linux.go
6
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)
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
Loading…
Reference in New Issue