diff options
Diffstat (limited to 'extras/libmemif/examples/icmp-responder/icmp-responder.go')
-rw-r--r-- | extras/libmemif/examples/icmp-responder/icmp-responder.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/extras/libmemif/examples/icmp-responder/icmp-responder.go b/extras/libmemif/examples/icmp-responder/icmp-responder.go index 79bb9d0..a7726bf 100644 --- a/extras/libmemif/examples/icmp-responder/icmp-responder.go +++ b/extras/libmemif/examples/icmp-responder/icmp-responder.go @@ -399,5 +399,13 @@ func main() { // Wait until an interrupt signal is received. sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt) - <-sigChan + var intErrch = memif.GetInterruptErrorChan() + select { + case err = <-intErrch: + fmt.Printf("Exit due to interface error: %v\n", err) + return + case <-sigChan: + fmt.Printf("Exit by os.Interrupt") + return + } } |