@@ -120,30 +120,26 @@ pub unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: i6
120
120
-> io:: Result < ssize_t >
121
121
{
122
122
weak ! ( fn pread64( c_int, * mut c_void, size_t, i64 ) -> ssize_t) ;
123
- unsafe {
124
- pread64. get ( ) . map ( |f| cvt ( f ( fd, buf, count, offset) ) ) . unwrap_or_else ( || {
125
- if let Ok ( o) = offset. try_into ( ) {
126
- cvt ( pread ( fd, buf, count, o) )
127
- } else {
128
- Err ( io:: Error :: new ( io:: ErrorKind :: InvalidInput ,
129
- "cannot pread >2GB" ) )
130
- }
131
- } )
132
- }
123
+ pread64. get ( ) . map ( |f| cvt ( f ( fd, buf, count, offset) ) ) . unwrap_or_else ( || {
124
+ if let Ok ( o) = offset. try_into ( ) {
125
+ cvt ( pread ( fd, buf, count, o) )
126
+ } else {
127
+ Err ( io:: Error :: new ( io:: ErrorKind :: InvalidInput ,
128
+ "cannot pread >2GB" ) )
129
+ }
130
+ } )
133
131
}
134
132
135
133
pub unsafe fn cvt_pwrite64 ( fd : c_int , buf : * const c_void , count : size_t , offset : i64 )
136
134
-> io:: Result < ssize_t >
137
135
{
138
136
weak ! ( fn pwrite64( c_int, * const c_void, size_t, i64 ) -> ssize_t) ;
139
- unsafe {
140
- pwrite64. get ( ) . map ( |f| cvt ( f ( fd, buf, count, offset) ) ) . unwrap_or_else ( || {
141
- if let Ok ( o) = offset. try_into ( ) {
142
- cvt ( pwrite ( fd, buf, count, o) )
143
- } else {
144
- Err ( io:: Error :: new ( io:: ErrorKind :: InvalidInput ,
145
- "cannot pwrite >2GB" ) )
146
- }
147
- } )
148
- }
137
+ pwrite64. get ( ) . map ( |f| cvt ( f ( fd, buf, count, offset) ) ) . unwrap_or_else ( || {
138
+ if let Ok ( o) = offset. try_into ( ) {
139
+ cvt ( pwrite ( fd, buf, count, o) )
140
+ } else {
141
+ Err ( io:: Error :: new ( io:: ErrorKind :: InvalidInput ,
142
+ "cannot pwrite >2GB" ) )
143
+ }
144
+ } )
149
145
}
0 commit comments