Merge pull request #539 from marysaka/fix/map_data_clone

aya: Fix MapData Clone implementation
pull/541/head
Alessandro Decina 2 years ago committed by GitHub
commit 113e3ef018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -635,12 +635,7 @@ impl Clone for MapData {
fn clone(&self) -> MapData { fn clone(&self) -> MapData {
MapData { MapData {
obj: self.obj.clone(), obj: self.obj.clone(),
fd: { fd: self.fd.map(|fd| unsafe { libc::dup(fd) }),
if let Some(fd) = self.fd {
unsafe { Some(libc::dup(fd)) };
}
None
},
btf_fd: self.btf_fd, btf_fd: self.btf_fd,
pinned: self.pinned, pinned: self.pinned,
} }

Loading…
Cancel
Save