mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-28 03:43:23 +00:00
Fix issue about pathname and redefine the Filetype.
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d8389da797
commit
12b355b701
@ -37,8 +37,8 @@ pub fn sys_linkat(
|
||||
return_errno_with_message!(Errno::ENOENT, "oldpath is empty");
|
||||
}
|
||||
let new_path = new_path.to_string_lossy();
|
||||
if new_path.ends_with('/') || new_path.is_empty() {
|
||||
return_errno_with_message!(Errno::ENOENT, "newpath is dir or is empty");
|
||||
if new_path.is_empty() {
|
||||
return_errno_with_message!(Errno::ENOENT, "newpath is empty");
|
||||
}
|
||||
|
||||
let old_fs_path = FsPath::new(old_dirfd, old_path.as_ref())?;
|
||||
@ -49,7 +49,7 @@ pub fn sys_linkat(
|
||||
} else {
|
||||
fs.lookup_no_follow(&old_fs_path)?
|
||||
};
|
||||
let (new_dir_dentry, new_name) = fs.lookup_dir_and_base_name(&new_fs_path)?;
|
||||
let (new_dir_dentry, new_name) = fs.lookup_dir_and_new_basename(&new_fs_path, false)?;
|
||||
(old_dentry, new_dir_dentry, new_name)
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user