This commit is contained in:
parent
75a26c064d
commit
255e647c5e
|
@ -23,11 +23,10 @@ func main() {
|
||||||
|
|
||||||
// Goroutine to handle os signals (nuke fim so we can get to config ui)
|
// Goroutine to handle os signals (nuke fim so we can get to config ui)
|
||||||
go func() {
|
go func() {
|
||||||
for sig := range sigs {
|
for range sigs {
|
||||||
fmt.Println(sig)
|
|
||||||
if fim != nil { // Just in case someone lays on ctrl-c or similar during startup
|
if fim != nil { // Just in case someone lays on ctrl-c or similar during startup
|
||||||
if err := fim.Process.Kill(); err != nil {
|
if err := fim.Process.Kill(); err != nil {
|
||||||
log.Fatal("failed to kill process: ", err)
|
log.Fatalf("failed to kill process: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +40,7 @@ func main() {
|
||||||
// Unwrap the error a bit so we can find out if a signal killed fim or something else
|
// Unwrap the error a bit so we can find out if a signal killed fim or something else
|
||||||
// An exit code of -1 means the program didn't exit in time or was terminated by a signal (per the docs)
|
// An exit code of -1 means the program didn't exit in time or was terminated by a signal (per the docs)
|
||||||
if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() != -1 {
|
if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() != -1 {
|
||||||
log.Fatalf("Error : ", err)
|
log.Fatalf("Error : %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue