Skip to content

Commit

Permalink
Merge pull request #1 from geyslan/dylane/autoattach
Browse files Browse the repository at this point in the history
chore(prog): Add autoattach api
  • Loading branch information
chentao-kernel authored Mar 14, 2024
2 parents 7279938 + 4c71151 commit 19fbcd7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions selftest/set-attach/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ func main() {
os.Exit(-1)
}

prog.SetAutoattach(false)
if prog.Autoattach() {
fmt.Println(os.Stderr, "set auto attach failed")
// Test auto attach
autoAttachOrig := prog.Autoattach()
prog.SetAutoattach(!autoAttachOrig)
if prog.Autoattach() == autoAttachOrig {
fmt.Fprintln(os.Stderr, "set auto attach failed")
os.Exit(-1)
}
prog.SetAutoattach(true)
prog.SetAutoattach(autoAttachOrig)

err = bpfModule.BPFLoadObject()
if err != nil {
Expand Down

0 comments on commit 19fbcd7

Please sign in to comment.