@@ -3,7 +3,7 @@ use super::hermit_abi::{
3
3
self , DT_DIR , DT_LNK , DT_REG , DT_UNKNOWN , O_APPEND , O_CREAT , O_DIRECTORY , O_EXCL , O_RDONLY ,
4
4
O_RDWR , O_TRUNC , O_WRONLY , S_IFDIR , S_IFLNK , S_IFMT , S_IFREG , dirent64, stat as stat_struct,
5
5
} ;
6
- use crate :: ffi:: { CStr , OsStr , OsString } ;
6
+ use crate :: ffi:: { CStr , OsStr , OsString , c_char } ;
7
7
use crate :: io:: { self , BorrowedCursor , Error , ErrorKind , IoSlice , IoSliceMut , SeekFrom } ;
8
8
use crate :: os:: hermit:: ffi:: OsStringExt ;
9
9
use crate :: os:: hermit:: io:: { AsFd , AsRawFd , BorrowedFd , FromRawFd , IntoRawFd , RawFd } ;
@@ -204,7 +204,7 @@ impl Iterator for ReadDir {
204
204
// the size of dirent64. The file name is always a C string and terminated by `\0`.
205
205
// Consequently, we are able to ignore the last byte.
206
206
let name_bytes =
207
- unsafe { CStr :: from_ptr ( & dir. d_name as * const _ as * const i8 ) . to_bytes ( ) } ;
207
+ unsafe { CStr :: from_ptr ( & dir. d_name as * const _ as * const c_char ) . to_bytes ( ) } ;
208
208
let entry = DirEntry {
209
209
root : self . inner . root . clone ( ) ,
210
210
ino : dir. d_ino ,
@@ -445,7 +445,7 @@ impl DirBuilder {
445
445
446
446
pub fn mkdir ( & self , path : & Path ) -> io:: Result < ( ) > {
447
447
run_path_with_cstr ( path, & |path| {
448
- cvt ( unsafe { hermit_abi:: mkdir ( path. as_ptr ( ) , self . mode . into ( ) ) } ) . map ( |_| ( ) )
448
+ cvt ( unsafe { hermit_abi:: mkdir ( path. as_ptr ( ) . cast ( ) , self . mode . into ( ) ) } ) . map ( |_| ( ) )
449
449
} )
450
450
}
451
451
0 commit comments