Browse Source

修复unlink、unlinkat系统调用的路径错误 (#892)

MemoryShore 7 months ago
parent
commit
f4acaec4ea
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kernel/src/filesystem/vfs/core.rs

+ 1 - 1
kernel/src/filesystem/vfs/core.rs

@@ -239,7 +239,7 @@ pub fn do_unlink_at(dirfd: i32, path: &str) -> Result<u64, SystemError> {
         return Err(SystemError::EPERM);
     }
 
-    let (filename, parent_path) = rsplit_path(path);
+    let (filename, parent_path) = rsplit_path(&remain_path);
     // 查找父目录
     let parent_inode: Arc<dyn IndexNode> = inode_begin
         .lookup_follow_symlink(parent_path.unwrap_or("/"), VFS_MAX_FOLLOW_SYMLINK_TIMES)?;