From 3b7911f105339ba9bc073bf4f26b5c90a3b19b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 10 Jan 2003 11:08:51 +0000 Subject: [PATCH] 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 --- src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index bcbdde843d..8c14cbb1e0 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -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);