2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -284,9 +284,9 @@ impl FileDesc {
284
284
super :: weak:: weak!( fn preadv( libc:: c_int, * const libc:: iovec, libc:: c_int, off64_t) -> isize ) ;
285
285
286
286
match preadv. get ( ) {
287
- Some ( preadv ) => {
287
+ Some ( read ) => {
288
288
let ret = cvt ( unsafe {
289
- preadv (
289
+ read (
290
290
self . as_raw_fd ( ) ,
291
291
bufs. as_mut_ptr ( ) as * mut libc:: iovec as * const libc:: iovec ,
292
292
cmp:: min ( bufs. len ( ) , max_iov ( ) ) as libc:: c_int ,
@@ -477,9 +477,9 @@ impl FileDesc {
477
477
super :: weak:: weak!( fn pwritev( libc:: c_int, * const libc:: iovec, libc:: c_int, off64_t) -> isize ) ;
478
478
479
479
match pwritev. get ( ) {
480
- Some ( pwritev ) => {
480
+ Some ( read ) => {
481
481
let ret = cvt ( unsafe {
482
- pwritev (
482
+ read (
483
483
self . as_raw_fd ( ) ,
484
484
bufs. as_ptr ( ) as * const libc:: iovec ,
485
485
cmp:: min ( bufs. len ( ) , max_iov ( ) ) as libc:: c_int ,
Original file line number Diff line number Diff line change @@ -62,15 +62,16 @@ impl<F: Copy> ExternWeak<F> {
62
62
}
63
63
64
64
pub ( crate ) macro dlsym {
65
- ( fn $name: ident( $( $t: ty) , * ) -> $ret: ty) => (
66
- dlsym ! ( fn $name( $( $t) , * ) -> $ret, stringify!( $name) ) ;
65
+ ( $v : vis fn $name: ident( $( $t: ty) , * ) -> $ret: ty) => (
66
+ dlsym ! ( $v fn $name( $( $t) , * ) -> $ret, stringify!( $name) ) ;
67
67
) ,
68
- ( fn $name: ident( $( $t: ty) , * ) -> $ret: ty, $sym: expr) => (
69
- static DLSYM : DlsymWeak < unsafe extern "C" fn ( $( $t) , * ) -> $ret> =
68
+ ( $v: vis fn $name: ident( $( $t: ty) , * ) -> $ret: ty, $sym: expr) => (
69
+ #[ allow ( non_upper_case_globals ) ]
70
+ $v static $name: DlsymWeak < unsafe extern "C" fn ( $( $t) , * ) -> $ret> =
70
71
DlsymWeak :: new ( concat ! ( $sym, '\0' ) ) ;
71
- let $name = & DLSYM ;
72
72
)
73
73
}
74
+
74
75
pub ( crate ) struct DlsymWeak < F > {
75
76
name : & ' static str ,
76
77
func : AtomicPtr < libc:: c_void > ,
0 commit comments