浏览代码

COMP: Another borland bug

Andy Cedilnik 20 年之前
父节点
当前提交
2c30cb64b1
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      Utilities/cmtar/extract.c

+ 10 - 0
Utilities/cmtar/extract.c

@@ -564,6 +564,16 @@ tar_extract_dir(TAR *t, char *realname)
   if (mkdir(filename, mode) == -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)
     {
       if (chmod(filename, mode) == -1)