Handle renaming root directory correctly

This commit is contained in:
Sebastian Messmer 2016-03-23 16:07:08 +00:00
parent c828a48c2b
commit db53b597d4

View File

@ -55,8 +55,7 @@ void CryNode::rename(const bf::path &to) {
device()->callFsActionCallbacks();
if (_parent == none) {
//We are the root direcory.
//TODO What should we do?
throw FuseErrnoException(EIO);
throw FuseErrnoException(EBUSY);
}
//TODO More efficient implementation possible: directly rename when it's actually not moved to a different directory
// It's also quite ugly code because in the parent==targetDir case, it depends on _parent not overriding the changes made by targetDir.