Fix issue with rename to relative destination

This commit is contained in:
James Matlik
2025-06-11 23:37:46 -04:00
parent be49c1936a
commit 19de978799
+1
View File
@@ -855,6 +855,7 @@ impl Pal for Sys {
fn rename(oldpath: CStr, newpath: CStr) -> Result<()> {
let newpath = newpath.to_str().map_err(|_| Errno(EINVAL))?;
let newpath = canonicalize(newpath).map_err(|_| Errno(EINVAL))?;
let file = File::open(oldpath, fcntl::O_PATH | fcntl::O_CLOEXEC)?;
syscall::frename(*file as usize, newpath)?;