From: František Dvořák Date: Thu, 10 Oct 2013 12:44:13 +0000 (+0200) Subject: test-rename test hack. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=263e853a7b8cd0a49c95b7001421d9414d37db56;p=dmlite-plugins-vfs.git test-rename test hack. --- diff --git a/src/VfsNs.cpp b/src/VfsNs.cpp index 3309244..a6ff7bf 100644 --- a/src/VfsNs.cpp +++ b/src/VfsNs.cpp @@ -380,7 +380,14 @@ void VfsCatalog::makeDir(const std::string& path, mode_t mode) throw (DmExceptio void VfsCatalog::rename(const std::string& oldPath, const std::string& newPath) throw (DmException) { - wrapCall(::rename(oldPath.c_str(), newPath.c_str())); + // XXX: test-rename should probably accept both ENOTEMPTY and EEXIST instead + // of changing it here? + try { + wrapCall(::rename(oldPath.c_str(), newPath.c_str())); + } catch (DmException e) { + if (e.code() == ENOTEMPTY) e = DmException(EEXIST, e.what()); + throw e; + } }