mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel/FileSystem: Remove FIXME about old/new path being the same
Added comment after confirming that Linux and OpenBSD implenment the same behavior.
This commit is contained in:
parent
d57e9b53a0
commit
a91fc697bb
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/tajmorton Commit: https://github.com/SerenityOS/serenity/commit/a91fc697bb Pull-request: https://github.com/SerenityOS/serenity/pull/16754 Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 5 additions and 1 deletions
|
@ -648,7 +648,11 @@ ErrorOr<void> VirtualFileSystem::rename(Credentials const& credentials, Custody&
|
|||
if (!new_custody_or_error.is_error()) {
|
||||
auto& new_custody = *new_custody_or_error.value();
|
||||
auto& new_inode = new_custody.inode();
|
||||
// FIXME: Is this really correct? Check what other systems do.
|
||||
// When the source/dest inodes are the same (in other words,
|
||||
// when `old_path` and `new_path` are the same), perform a no-op
|
||||
// and return success.
|
||||
// Linux (`vfs_rename()`) and OpenBSD (`dorenameat()`) appear to have
|
||||
// this same no-op behavior.
|
||||
if (&new_inode == &old_inode)
|
||||
return {};
|
||||
if (new_parent_inode.metadata().is_sticky()) {
|
||||
|
|
Loading…
Reference in a new issue