File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ static GETRANDOM: LazyPtr = LazyPtr::new();
29
29
30
30
fn dlsym_getrandom ( ) -> * mut c_void {
31
31
static NAME : & [ u8 ] = b"getrandom\0 " ;
32
- let name_ptr = NAME . as_ptr ( ) as * const libc:: c_char ;
32
+ let name_ptr = NAME . as_ptr ( ) . cast :: < libc:: c_char > ( ) ;
33
33
unsafe { libc:: dlsym ( libc:: RTLD_DEFAULT , name_ptr) }
34
34
}
35
35
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ pub fn sys_fill_exact(
74
74
pub unsafe fn open_readonly ( path : & str ) -> Result < libc:: c_int , Error > {
75
75
debug_assert_eq ! ( path. as_bytes( ) . last( ) , Some ( & 0 ) ) ;
76
76
loop {
77
- let fd = libc:: open ( path. as_ptr ( ) as * const _ , libc:: O_RDONLY | libc:: O_CLOEXEC ) ;
77
+ let fd = libc:: open (
78
+ path. as_ptr ( ) . cast :: < libc:: c_char > ( ) ,
79
+ libc:: O_RDONLY | libc:: O_CLOEXEC ,
80
+ ) ;
78
81
if fd >= 0 {
79
82
return Ok ( fd) ;
80
83
}
You can’t perform that action at this time.
0 commit comments