Merge pull request #355 from dave-tucker/rm-map-pin-path

aya: Remove MapError::InvalidPinPath
pull/357/head
Dave Tucker 2 years ago committed by GitHub
commit 55a7e3c4d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -102,13 +102,6 @@ pub enum MapError {
name: String,
},
/// Pin path is invalid
#[error("invalid map path `{error}`")]
InvalidPinPath {
/// The error message
error: String,
},
/// The map has not been created
#[error("the map has not been created")]
NotCreated,
@ -300,14 +293,7 @@ impl Map {
return Err(MapError::AlreadyCreated { name: name.into() });
}
let map_path = path.as_ref().join(name);
let path_string = match CString::new(map_path.to_str().unwrap()) {
Ok(s) => s,
Err(e) => {
return Err(MapError::InvalidPinPath {
error: e.to_string(),
})
}
};
let path_string = CString::new(map_path.to_str().unwrap()).unwrap();
let fd =
bpf_get_object(&path_string).map_err(|(code, io_error)| MapError::SyscallError {
call: "BPF_OBJ_GET".to_string(),

Loading…
Cancel
Save