File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -326,9 +326,9 @@ impl FileDesc {
326326 ) ;
327327
328328 match preadv. get ( ) {
329- Some ( preadv ) => {
329+ Some ( read ) => {
330330 let ret = cvt ( unsafe {
331- preadv (
331+ read (
332332 self . as_raw_fd ( ) ,
333333 bufs. as_mut_ptr ( ) as * mut libc:: iovec as * const libc:: iovec ,
334334 cmp:: min ( bufs. len ( ) , max_iov ( ) ) as libc:: c_int ,
@@ -532,9 +532,9 @@ impl FileDesc {
532532 ) ;
533533
534534 match pwritev. get ( ) {
535- Some ( pwritev ) => {
535+ Some ( read ) => {
536536 let ret = cvt ( unsafe {
537- pwritev (
537+ read (
538538 self . as_raw_fd ( ) ,
539539 bufs. as_ptr ( ) as * const libc:: iovec ,
540540 cmp:: min ( bufs. len ( ) , max_iov ( ) ) as libc:: c_int ,
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ use crate::{mem, ptr};
88mod tests;
99
1010pub ( crate ) macro weak {
11- ( fn $name: ident( $( $param: ident : $t: ty) , * $( , ) ?) -> $ret: ty; ) => (
12- static DLSYM : DlsymWeak <unsafe extern "C" fn ( $( $t) , * ) -> $ret> = {
11+ ( $v: vis fn $name: ident( $( $param: ident : $t: ty) , * $( , ) ?) -> $ret: ty ; ) => {
12+ #[ allow( non_upper_case_globals) ]
13+ $v static $name: DlsymWeak <unsafe extern "C" fn ( $( $t) , * ) -> $ret> = {
1314 let Ok ( name) = CStr :: from_bytes_with_nul ( concat ! ( stringify!( $name) , '\0' ) . as_bytes ( ) ) else {
1415 panic ! ( "symbol name may not contain NUL" )
1516 } ;
@@ -20,9 +21,7 @@ pub(crate) macro weak {
2021 // the function pointer be unsafe.
2122 unsafe { DlsymWeak :: new ( name) }
2223 } ;
23-
24- let $name = & DLSYM ;
25- )
24+ }
2625}
2726
2827pub ( crate ) struct DlsymWeak < F > {
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ fn weak_existing() {
1111 fn strlen( cs: * const c_char) -> usize ;
1212 }
1313
14- let strlen = strlen. get ( ) . unwrap ( ) ;
15- assert_eq ! ( unsafe { strlen ( TEST_STRING . as_ptr( ) ) } , TEST_STRING . count_bytes( ) ) ;
14+ let len = strlen. get ( ) . unwrap ( ) ;
15+ assert_eq ! ( unsafe { len ( TEST_STRING . as_ptr( ) ) } , TEST_STRING . count_bytes( ) ) ;
1616}
1717
1818#[ test]
You can’t perform that action at this time.
0 commit comments