Skip to content

Commit

Permalink
Merge pull request #1 from brammittendorff/feature_added-windows-support
Browse files Browse the repository at this point in the history
Added windows support
  • Loading branch information
mjrider authored Oct 31, 2024
2 parents cb3482e + 52cdaa9 commit a5c9dfd
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 a5c9dfd

Please sign in to comment.