Skip to content

Commit

Permalink
Fix build lifetime issue on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmonday committed Apr 8, 2022
1 parent 1dc1227 commit 6031469
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pnet_datalink/src/bpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ pub fn channel(network_interface: &NetworkInterface, config: Config) -> io::Resu
for i in 0..attempts {
let fd = unsafe {
let file_name = format!("/dev/bpf{}", i);
let c_file_name = CString::new(file_name.as_bytes()).unwrap();
libc::open(
CString::new(file_name.as_bytes()).unwrap().as_ptr(),
c_file_name.as_ptr(),
libc::O_RDWR,
0,
)
Expand Down

0 comments on commit 6031469

Please sign in to comment.