Fix canonicalize
This commit is contained in:
parent
3a1bb2ba26
commit
d73d32f58d
1 changed files with 2 additions and 3 deletions
|
|
@ -452,9 +452,8 @@ pub fn lstat(p: &Path) -> io::Result<FileAttr> {
|
|||
}
|
||||
|
||||
pub fn canonicalize(p: &Path) -> io::Result<PathBuf> {
|
||||
let mut options = OpenOptions::new();
|
||||
options.read(true);
|
||||
let file = File::open(p, &options)?;
|
||||
let fd = cvt(open(p.to_str().unwrap(), libc::O_CLOEXEC | libc::O_STAT))?;
|
||||
let file = File(FileDesc::new(fd));
|
||||
file.path()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue