From: František Dvořák Date: Fri, 13 Sep 2013 15:26:22 +0000 (+0200) Subject: test-rename test hack. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=4d6e890500b30e39d21516ba86cb2d3bb36cd060;p=dmlite-plugins-vfs-old.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; + } }