Skip to content

Commit

Permalink
Fix handling of SIGTERM signal
Browse files Browse the repository at this point in the history
  • Loading branch information
baierjan committed Nov 9, 2023
1 parent 3cec4e0 commit 3feb13e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/oled/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ func main() {

// Install signal handler
signal_chan := make(chan os.Signal, 1)
signal.Notify(signal_chan, os.Interrupt, os.Kill)
signal.Notify(signal_chan, os.Interrupt, os.Kill, syscall.SIGTERM)

go func() {
for {
s := <-signal_chan
switch s {
case os.Interrupt, os.Kill:
case os.Interrupt, os.Kill, syscall.SIGTERM:
log.Print("Exiting...")
dev.Halt()
bus.Close()
Expand Down

0 comments on commit 3feb13e

Please sign in to comment.