Skip to content

Commit

Permalink
Use hex formatter to parse map flags
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy authored and tgraf committed Mar 6, 2017
1 parent 0dfec1b commit 24486bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/bpf/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func GetMapInfo(pid int, fd int) (*MapInfo, error) {
info.ValueSize = uint32(value)
} else if n, err := fmt.Sscanf(line, "max_entries:\t%d", &value); n == 1 && err == nil {
info.MaxEntries = uint32(value)
} else if n, err := fmt.Sscanf(line, "map_flags:\t%i", &value); n == 1 && err == nil {
} else if n, err := fmt.Sscanf(line, "map_flags:\t%x", &value); n == 1 && err == nil {
info.Flags = uint32(value)
}
}
Expand Down

0 comments on commit 24486bf

Please sign in to comment.