summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/Util.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-05 19:21:01 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-05 19:21:01 +0000
commit218976f476d34c083d0ca3b3ab1cc4c92a547da0 (patch)
tree3284443b6c73e7ed87584b4698fbb18bd81c3f9a /cpp/src/IcePatch/Util.cpp
parentChanged exception and property names. (diff)
downloadice-218976f476d34c083d0ca3b3ab1cc4c92a547da0.tar.bz2
ice-218976f476d34c083d0ca3b3ab1cc4c92a547da0.tar.xz
ice-218976f476d34c083d0ca3b3ab1cc4c92a547da0.zip
fixes
Diffstat (limited to 'cpp/src/IcePatch/Util.cpp')
-rw-r--r--cpp/src/IcePatch/Util.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp
index 95ad0794e35..296f8d54b5b 100644
--- a/cpp/src/IcePatch/Util.cpp
+++ b/cpp/src/IcePatch/Util.cpp
@@ -184,13 +184,26 @@ IcePatch::removeRecursive(const string& path)
{
removeRecursive(*p);
}
- }
- if(::remove(path.c_str()) == -1)
+#ifdef _WIN32
+ if(_rmdir(path.c_str()) == -1)
+#else
+ if(rmdir(path.c_str()) == -1)
+#endif
+ {
+ FileAccessException ex;
+ ex.reason = "cannot remove directory `" + path + "': " + strerror(errno);
+ throw ex;
+ }
+ }
+ else
{
- FileAccessException ex;
- ex.reason = "cannot remove file `" + path + "': " + strerror(errno);
- throw ex;
+ if(::remove(path.c_str()) == -1)
+ {
+ FileAccessException ex;
+ ex.reason = "cannot remove file `" + path + "': " + strerror(errno);
+ throw ex;
+ }
}
}