From 263e853a7b8cd0a49c95b7001421d9414d37db56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 10 Oct 2013 14:44:13 +0200 Subject: [PATCH] test-rename test hack. --- src/VfsNs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; + } } -- 1.8.2.3