mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-09-22 05:54:41 -04:00
Use proper c_char ffi type
This commit is contained in:
parent
9e690408c9
commit
47e9029456
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ cfg_if! {
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::os::raw::c_int;
|
use std::os::raw::{c_int, c_char};
|
||||||
use tools::*;
|
use tools::*;
|
||||||
|
|
||||||
fn get_interface_name(index: u32) -> io::Result<String> {
|
fn get_interface_name(index: u32) -> io::Result<String> {
|
||||||
|
@ -37,7 +37,7 @@ fn get_interface_name(index: u32) -> io::Result<String> {
|
||||||
bail_io_error_other!("if_indextoname returned null");
|
bail_io_error_other!("if_indextoname returned null");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if unsafe { if_indextoname(index, ifnamebuf.as_mut_ptr() as *mut i8) }.is_null() {
|
if unsafe { if_indextoname(index, ifnamebuf.as_mut_ptr() as *mut c_char) }.is_null() {
|
||||||
bail_io_error_other!("if_indextoname returned null");
|
bail_io_error_other!("if_indextoname returned null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue