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> {
15
15
unsafe {
16
16
let file = libc:: open ( path. as_ptr ( ) as * const libc:: c_char , libc:: O_RDONLY ) ;
17
17
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}" ) ) ;
19
19
}
20
20
21
21
let mut data = Vec :: new ( ) ;
@@ -25,10 +25,7 @@ fn read_file(orig_path: &str) -> Result<Vec<u8>, alloc::string::String> {
25
25
match libc:: read ( file, spare. as_mut_ptr ( ) as * mut _ , spare. len ( ) ) {
26
26
-1 => {
27
27
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}" ) ) ;
32
29
}
33
30
0 => break ,
34
31
n => data. set_len ( data. len ( ) + n as usize ) ,
You can’t perform that action at this time.
0 commit comments