rust stat should call libc stat

This commit is contained in:
Baoshan Pang 2019-09-20 15:47:13 -07:00
parent 66b16496e6
commit b956ae38e1

View File

@ -529,7 +529,7 @@ pub fn stat(p: &Path) -> io::Result<FileAttr> {
let p = cstr(p)?;
let mut stat: stat64 = unsafe { mem::zeroed() };
cvt(unsafe {
libc::lstat(p.as_ptr(), &mut stat as *mut _ as *mut _)
libc::stat(p.as_ptr(), &mut stat as *mut _ as *mut _)
})?;
Ok(FileAttr { stat })
}