File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ int git_futils_mkdir(
277
277
mode_t mode ,
278
278
uint32_t flags )
279
279
{
280
- int error = -1 ;
280
+ int error = -1 , tmp_errno ;
281
281
git_buf make_path = GIT_BUF_INIT ;
282
282
ssize_t root = 0 ;
283
283
char lastch , * tail ;
@@ -345,18 +345,26 @@ int git_futils_mkdir(
345
345
346
346
already_exists = 1 ;
347
347
break ;
348
+ #ifdef GIT_WIN32
349
+ case EACCES :
350
+ #endif
348
351
case ENOSYS :
349
- /* Solaris can generate this error if you try to mkdir
350
- * a path which is already a mount point. In that case,
351
- * the path does already exist; but it's not implied by
352
+ /* The following errors can be generated if:
353
+ * EACCES - Win32 can generate this error if you try to mkdir
354
+ * a path which is the root of a volume.
355
+ * ENOSYS - Solaris can generate a ENOSYS error if you try to mkdir
356
+ * a path which is already a mount point.
357
+ * In these cases, the path does already exist; but it's not implied by
352
358
* the definition of the error, so let's recheck */
359
+ tmp_errno = errno ;
360
+
353
361
if (git_path_isdir (make_path .ptr )) {
354
362
already_exists = 1 ;
355
363
break ;
356
364
}
357
365
358
366
/* Fall through */
359
- errno = ENOSYS ;
367
+ errno = tmp_errno ;
360
368
default :
361
369
giterr_set (GITERR_OS , "Failed to make directory '%s'" ,
362
370
make_path .ptr );
You can’t perform that action at this time.
0 commit comments