Rollup merge of #51786 - cuviper:stat64-pointers, r=Mark-Simulacrum
Remove unnecessary stat64 pointer casts In effect, these just casted `&mut stat64` to `*mut stat64`, twice. That's harmless, but it masked a problem when this was copied to new code calling `fstatat`, which takes a pointer to `struct stat`. That will be fixed by #51785, but let's remove the unnecessary casts here too.
This commit is contained in:
@@ -803,7 +803,7 @@ pub fn stat(p: &Path) -> io::Result<FileAttr> {
|
||||
let p = cstr(p)?;
|
||||
let mut stat: stat64 = unsafe { mem::zeroed() };
|
||||
cvt(unsafe {
|
||||
stat64(p.as_ptr(), &mut stat as *mut _ as *mut _)
|
||||
stat64(p.as_ptr(), &mut stat)
|
||||
})?;
|
||||
Ok(FileAttr { stat: stat })
|
||||
}
|
||||
@@ -812,7 +812,7 @@ pub fn lstat(p: &Path) -> io::Result<FileAttr> {
|
||||
let p = cstr(p)?;
|
||||
let mut stat: stat64 = unsafe { mem::zeroed() };
|
||||
cvt(unsafe {
|
||||
lstat64(p.as_ptr(), &mut stat as *mut _ as *mut _)
|
||||
lstat64(p.as_ptr(), &mut stat)
|
||||
})?;
|
||||
Ok(FileAttr { stat: stat })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user