diff options
| author | Paul Buetow <paul@buetow.org> | 2025-03-19 22:25:13 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-03-19 22:25:13 +0200 |
| commit | 0cbf33424a4034bc18c433cb6bf8fd72544a05b4 (patch) | |
| tree | 3834229aa0a1ff483114105fc8f2478379fdf42c /internal/ior.go | |
| parent | 155f630a61e353b623837c5403e0a85b8792d671 (diff) | |
fix deadlock when exiting of ior doesn't work when there are no events
Diffstat (limited to 'internal/ior.go')
| -rw-r--r-- | internal/ior.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/ior.go b/internal/ior.go index 0de3636..0b52340 100644 --- a/internal/ior.go +++ b/internal/ior.go @@ -91,11 +91,12 @@ func Run(flags flags.Flags) { fmt.Println("Probing for", duration) ctx, cancel := context.WithTimeout(context.Background(), duration) - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt, syscall.SIGTERM) + signalCh := make(chan os.Signal, 1) + signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM) go func() { - <-c + <-signalCh + fmt.Println("Received signal, shutting down...") cancel() }() |
