We now check in bfs_rename() if the new name is the same as the old name

in the same directory - in this case, we will return B_OK (as nothing has
to be done to fulfill the request), instead of B_BAD_VALUE which would
be thrown later in the process.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2400 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-01-10 11:08:51 +00:00
parent a8dee23ea0
commit 3b7911f105
1 changed files with 5 additions and 1 deletions

View File

@ -311,7 +311,7 @@ bfs_write_fs_stat(void *_ns, struct fs_info *info, long mask)
FUNCTION_START(("mask = %ld\n",mask));
Volume *volume = (Volume *)_ns;
disk_super_block &superBlock = volume->SuperBlock();
Locker locker(volume->Lock());
status_t status = B_BAD_VALUE;
@ -991,6 +991,10 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c
Inode *oldDirectory = (Inode *)_oldDir;
Inode *newDirectory = (Inode *)_newDir;
// are we already done?
if (oldDirectory == newDirectory && !strcmp(oldName, newName))
return B_OK;
// get the directory's tree, and a pointer to the inode which should be changed
BPlusTree *tree;
status_t status = oldDirectory->GetTree(&tree);