Skip to content

Commit

Permalink
aya: fix create pinned map path.
Browse files Browse the repository at this point in the history
`MapData::create_pinned` is supposed to call `map.pin`(BPF_OBJ_PIN) if
`BPF_OBJ_GET` syscall return error, but it joins `name` redundantly,
making `path/map_name` to be `path/map_name/map_name`.This
commit fixed it.
  • Loading branch information
lx200916 committed Oct 2, 2023
1 parent c547dd7 commit 8e5f1c6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion aya/src/maps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ impl MapData {
}
Err(_) => {
let mut map = Self::create(obj, name, btf_fd)?;
let path = path.join(name);
map.pin(&path).map_err(|error| MapError::PinError {
name: Some(name.into()),
error,
Expand Down

0 comments on commit 8e5f1c6

Please sign in to comment.