File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ impl<F: FileSystem + Sync> Server<F> {
571571 } ;
572572
573573 w. write_all ( out. as_slice ( ) ) . map_err ( Error :: EncodeMessage ) ?;
574- w. commit ( & [ & data_writer. 0 ] ) . map_err ( Error :: IoError ) ?;
574+ w. commit ( & [ & data_writer. 0 ] ) . map_err ( Error :: EncodeMessage ) ?;
575575 Ok ( out. len as usize )
576576 }
577577 Err ( e) => reply_error ( e, in_header. unique , w) ,
@@ -976,7 +976,7 @@ impl<F: FileSystem + Sync> Server<F> {
976976 } ;
977977
978978 w. write_all ( out. as_slice ( ) ) . map_err ( Error :: EncodeMessage ) ?;
979- w. commit ( & [ & cursor] ) . map_err ( Error :: IoError ) ?;
979+ w. commit ( & [ & cursor] ) . map_err ( Error :: EncodeMessage ) ?;
980980 Ok ( out. len as usize )
981981 }
982982 }
Original file line number Diff line number Diff line change @@ -75,8 +75,6 @@ pub enum Error {
7575 /// The `size` field of the `SetxattrIn` message does not match the length
7676 /// of the decoded value.
7777 InvalidXattrSize ( ( u32 , usize ) ) ,
78- /// An IO related error has happened.
79- IoError ( io:: Error ) ,
8078}
8179
8280impl error:: Error for Error { }
@@ -96,7 +94,6 @@ impl fmt::Display for Error {
9694 decoded value: size = {}, value.len() = {}",
9795 size, len
9896 ) ,
99- IoError ( err) => write ! ( f, "fail to handle request: {}" , err) ,
10097 }
10198 }
10299}
Original file line number Diff line number Diff line change @@ -163,7 +163,9 @@ impl<'a> Writer<'a> {
163163 if !buf. is_empty ( ) {
164164 return writev ( self . fd , buf. as_slice ( ) ) . map_err ( |e| {
165165 error ! { "fail to write to fuse device on commit: {}" , e} ;
166- io:: Error :: new ( io:: ErrorKind :: Other , format ! ( "{}" , e) )
166+ e. as_errno ( )
167+ . and_then ( |r| Some ( io:: Error :: from_raw_os_error ( r as i32 ) ) )
168+ . unwrap_or_else ( || io:: Error :: new ( io:: ErrorKind :: Other , format ! ( "{}" , e) ) )
167169 } ) ;
168170 }
169171 Ok ( 0 )
You can’t perform that action at this time.
0 commit comments