Skip to content

Commit

Permalink
Merge pull request #539 from marysaka/fix/map_data_clone
Browse files Browse the repository at this point in the history
aya: Fix MapData Clone implementation
  • Loading branch information
alessandrod committed Mar 10, 2023
2 parents 8684a57 + 94049ec commit 113e3ef
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions aya/src/maps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,7 @@ impl Clone for MapData {
fn clone(&self) -> MapData {
MapData {
obj: self.obj.clone(),
fd: {
if let Some(fd) = self.fd {
unsafe { Some(libc::dup(fd)) };
}
None
},
fd: self.fd.map(|fd| unsafe { libc::dup(fd) }),
btf_fd: self.btf_fd,
pinned: self.pinned,
}
Expand Down

0 comments on commit 113e3ef

Please sign in to comment.