Skip to content

Commit

Permalink
aya: Fix MapData Clone implementation
Browse files Browse the repository at this point in the history
The Clone implementation of MapData was previously not storing the
result of the dup operation.
  • Loading branch information
marysaka committed Mar 10, 2023
1 parent 8684a57 commit d987c49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aya/src/maps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,10 @@ impl Clone for MapData {
obj: self.obj.clone(),
fd: {
if let Some(fd) = self.fd {
unsafe { Some(libc::dup(fd)) };
unsafe { Some(libc::dup(fd)) }
} else {
None
}
None
},
btf_fd: self.btf_fd,
pinned: self.pinned,
Expand Down

0 comments on commit d987c49

Please sign in to comment.