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:
Josh Stone
2018-06-25 12:34:33 -07:00
parent 8acec1f9d0
commit 490f49fd2a

View File

@@ -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 })
}