Skip to content

Commit

Permalink
Merge pull request #2 from mozillazg/fix-cancel
Browse files Browse the repository at this point in the history
fix the program cannot be terminated through ctrl-c
  • Loading branch information
jschwinger233 authored Mar 12, 2023
2 parents 105f01e + 84ffa45 commit 79533b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ func main() {

println("start tracing")
for {
select {
case <-ctx.Done():
return
default:
}

meta := bpf.SkbdumpSkbMeta{}
if err := bpfObjs.MetaQueue.LookupAndDelete(nil, &meta); err != nil {
select {
Expand Down

0 comments on commit 79533b0

Please sign in to comment.