Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hardcoded flag values #287

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions libbpfgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -1334,8 +1334,8 @@ func (p *BPFProg) SetAttachType(attachType BPFAttachType) {
// getCgroupDirFD returns a file descriptor for a given cgroup2 directory path
func getCgroupDirFD(cgroupV2DirPath string) (int, error) {
const (
O_DIRECTORY int = 0200000
O_RDONLY int = 00
O_DIRECTORY int = syscall.O_DIRECTORY
O_RDONLY int = syscall.O_RDONLY
)
fd, err := syscall.Open(cgroupV2DirPath, O_DIRECTORY|O_RDONLY, 0)
if fd < 0 {
Expand Down Expand Up @@ -1534,8 +1534,7 @@ func (p *BPFProg) AttachKretprobe(kp string) (*BPFLink, error) {
}

func (p *BPFProg) AttachNetns(networkNamespacePath string) (*BPFLink, error) {
const O_RDONLY int = 00
fd, err := syscall.Open(networkNamespacePath, O_RDONLY, 0)
fd, err := syscall.Open(networkNamespacePath, syscall.O_RDONLY, 0)
if fd < 0 {
return nil, fmt.Errorf("failed to open network namespace path %s: %w", networkNamespacePath, err)
}
Expand Down