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:
parent
8acec1f9d0
commit
490f49fd2a
1 changed files with 2 additions and 2 deletions
|
|
@ -787,7 +787,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 })
|
||||
}
|
||||
|
|
@ -796,7 +796,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 })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue