Skip to content

Commit

Permalink
Added windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
brammittendorff committed Oct 31, 2024
1 parent cb3482e commit 52cdaa9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
12 changes: 12 additions & 0 deletions exit_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// +build linux darwin

package main

import (
"syscall"
"os"
)

func exit() {
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
}
9 changes: 9 additions & 0 deletions exit_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// +build windows

package main

import "os"

func exit() {
os.Exit(0)
}
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net"
"os"
"os/signal"
"syscall"
"time"

_ "image/gif"
Expand Down Expand Up @@ -84,7 +83,7 @@ func fill(ch chan<- *net.IPAddr, frames [][]*net.IPAddr, delay []time.Duration,
for 0 != len(ch) {
time.Sleep(1 * time.Second)
}
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
exit()
return
}
// then wait on both
Expand Down

0 comments on commit 52cdaa9

Please sign in to comment.