diff options
author | Kusakabe Si <linux@kskb.eu.org> | 2021-07-05 17:03:20 +0800 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2021-07-27 13:02:29 +0000 |
commit | 24f179dbb9534ed7c05bee2a80f18b55443706ab (patch) | |
tree | 43d336e5b0f88f9b33242ef1bd05fb81eaa982a4 /extras/libmemif/examples/icmp-responder/icmp-responder.go | |
parent | 57de49f7583b8174c7f3d8e21956d4eaac64ac28 (diff) |
https://jira.fd.io/browse/GOVPP-21
Signed-off-by: Kusakabe Si <linux@kskb.eu.org>
Change-Id: Ib1761e3b93dae70680646ce7fdd78a1168fd0b9f
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 + } } |