X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/f8bd95b7a13dfe54d800e2d7ecdb0329f0798289..b6ff3c7dbab3f40d03389808d95ac27d416c35e3:/lunaix-os/kernel/fs/vfs.c diff --git a/lunaix-os/kernel/fs/vfs.c b/lunaix-os/kernel/fs/vfs.c index 7959fc3..6f4b3b0 100644 --- a/lunaix-os/kernel/fs/vfs.c +++ b/lunaix-os/kernel/fs/vfs.c @@ -1054,8 +1054,6 @@ __vfs_do_unlink(struct v_dnode* dnode) if (inode->open_count) { errno = EBUSY; } else if (!(inode->itype & VFS_IFDIR)) { - // The underlying unlink implementation should handle - // symlink case errno = inode->ops->unlink(inode); if (!errno) { vfs_d_free(dnode); @@ -1108,10 +1106,8 @@ __DEFINE_LXSYSCALL2(int, link, const char*, oldpath, const char*, newpath) errno = __vfs_try_locate_file(oldpath, &dentry, &to_link, 0); if (!errno) { errno = __vfs_try_locate_file( - newpath, &name_dentry, &name_file, FLOCATE_CREATE_EMPTY); + newpath, &name_dentry, &name_file, FLOCATE_CREATE_ONLY); if (!errno) { - errno = EEXIST; - } else if (name_file) { errno = vfs_link(to_link, name_file); } }