File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
library/std_detect/src/detect/os/linux Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ fn read_file(orig_path: &str) -> Result<Vec<u8>, alloc::string::String> {
1515 unsafe {
1616 let file = libc:: open ( path. as_ptr ( ) as * const libc:: c_char , libc:: O_RDONLY ) ;
1717 if file == -1 {
18- return Err ( format ! ( "Cannot open file at {orig_path}: {}" , * libc :: __errno_location ( ) ) ) ;
18+ return Err ( format ! ( "Cannot open file at {orig_path}" ) ) ;
1919 }
2020
2121 let mut data = Vec :: new ( ) ;
@@ -25,10 +25,7 @@ fn read_file(orig_path: &str) -> Result<Vec<u8>, alloc::string::String> {
2525 match libc:: read ( file, spare. as_mut_ptr ( ) as * mut _ , spare. len ( ) ) {
2626 -1 => {
2727 libc:: close ( file) ;
28- return Err ( format ! (
29- "Error while reading from file at {orig_path}: {}" ,
30- * libc:: __errno_location( )
31- ) ) ;
28+ return Err ( format ! ( "Error while reading from file at {orig_path}" ) ) ;
3229 }
3330 0 => break ,
3431 n => data. set_len ( data. len ( ) + n as usize ) ,
You can’t perform that action at this time.
0 commit comments