File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,14 @@ pub fn reread_partition_table(file: &mut fs::File) -> Result<(), BlockError> {
5454}
5555
5656/// Makes an ioctl call to obtain the sector size of a block device
57- pub fn get_sector_size ( file : & mut fs:: File ) -> Result < i32 , BlockError > {
57+ pub fn get_sector_size ( file : & mut fs:: File ) -> Result < u64 , BlockError > {
5858 let metadata = file. metadata ( ) . map_err ( BlockError :: Metadata ) ?;
5959 let mut sector_size = 512 ;
6060
6161 if metadata. st_mode ( ) & S_IFMT == S_IFBLK {
6262 match unsafe { ioctl:: blksszget ( file. as_raw_fd ( ) , & mut sector_size) } {
6363 Err ( err) => Err ( BlockError :: GetSectorSize ( err) ) ,
64- Ok ( 0 ) => Ok ( sector_size) ,
64+ Ok ( 0 ) => Ok ( sector_size. try_into ( ) . unwrap_or ( 512 ) ) ,
6565 Ok ( r) => Err ( BlockError :: InvalidReturnValue ( r) ) ,
6666 }
6767 } else {
You can’t perform that action at this time.
0 commit comments