summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar/util.c
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 15:35:23 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 15:35:23 (GMT)
commit9e0633c91090e3254056b33bf8bd1ec4533982a6 (patch)
treef680ede529eb7bb1c7739884038499e4b6229356 /Utilities/cmtar/util.c
parentbc447c7f92730303c16d34cbe3747854b4c776c3 (diff)
downloadCMake-9e0633c91090e3254056b33bf8bd1ec4533982a6.zip
CMake-9e0633c91090e3254056b33bf8bd1ec4533982a6.tar.gz
CMake-9e0633c91090e3254056b33bf8bd1ec4533982a6.tar.bz2
BUG: Several Borland fixes
Diffstat (limited to 'Utilities/cmtar/util.c')
-rw-r--r--Utilities/cmtar/util.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/Utilities/cmtar/util.c b/Utilities/cmtar/util.c
index 1959e0a..494847b 100644
--- a/Utilities/cmtar/util.c
+++ b/Utilities/cmtar/util.c
@@ -103,12 +103,24 @@ mkdirhier(char *path)
if (dst[0] != '\0')
strcat(dst, "/");
strcat(dst, dirp);
+ if (
#if defined(_WIN32) && !defined(__CYGWIN__)
- if (mkdir(dst) == -1)
+ mkdir(dst) == -1
#else
- if (mkdir(dst, 0777) == -1)
+ mkdir(dst, 0777) == -1
#endif
+ )
{
+#ifdef __BORLANDC__
+ /* There is a bug in the Borland Run time library which makes MKDIR
+ return EACCES when it should return EEXIST
+ if it is some other error besides directory exists
+ then return false */
+ if ( errno == EACCES)
+ {
+ errno = EEXIST;
+ }
+#endif
if (errno != EEXIST)
return -1;
}