Browse Source

Merge branch 'jh/mingw-unlink'

"unlink" emulation on MinGW has been optimized.

* jh/mingw-unlink:
  mingw: improve performance of mingw_unlink()
maint
Junio C Hamano 5 years ago
parent
commit
5a0482662f
  1. 3
      compat/mingw.c

3
compat/mingw.c

@ -290,6 +290,9 @@ int mingw_unlink(const char *pathname) @@ -290,6 +290,9 @@ int mingw_unlink(const char *pathname)
if (xutftowcs_path(wpathname, pathname) < 0)
return -1;

if (DeleteFileW(wpathname))
return 0;

/* read-only files cannot be removed */
_wchmod(wpathname, 0666);
while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {

Loading…
Cancel
Save