aya: Fix MapData Clone implementation

The Clone implementation of MapData was previously not storing the
result of the dup operation.
pull/539/head
Mary 2 years ago
parent 8684a5783d
commit 94049ec661

@ -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,
}

Loading…
Cancel
Save