File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ impl Weak {
117
117
// the use of non-Relaxed operations is probably unnecessary.
118
118
match self . addr . load ( Ordering :: Relaxed ) {
119
119
Self :: UNINIT => {
120
- let symbol = self . name . as_ptr ( ) as * const _ ;
120
+ // XXX/FIXME: Unchecked UTF-8-to-c_char cast.
121
+ let symbol = self . name . as_ptr ( ) . cast :: < libc:: c_char > ( ) ;
121
122
let addr = unsafe { libc:: dlsym ( libc:: RTLD_DEFAULT , symbol) } ;
122
123
// Synchronizes with the Acquire fence below
123
124
self . addr . store ( addr, Ordering :: Release ) ;
@@ -136,7 +137,11 @@ impl Weak {
136
137
pub unsafe fn open_readonly ( path : & str ) -> Result < libc:: c_int , Error > {
137
138
debug_assert_eq ! ( path. as_bytes( ) . last( ) , Some ( & 0 ) ) ;
138
139
loop {
139
- let fd = libc:: open ( path. as_ptr ( ) as * const _ , libc:: O_RDONLY | libc:: O_CLOEXEC ) ;
140
+ // XXX/FIXME: Unchecked UTF-8-to-c_char cast.
141
+ let fd = libc:: open (
142
+ path. as_ptr ( ) . cast :: < libc:: c_char > ( ) ,
143
+ libc:: O_RDONLY | libc:: O_CLOEXEC ,
144
+ ) ;
140
145
if fd >= 0 {
141
146
return Ok ( fd) ;
142
147
}
You can’t perform that action at this time.
0 commit comments