Merge pull request #2589 from jeffhostetler/unlink-perf-gfw

mingw: improve performance of mingw_unlink()
This commit is contained in:
Jeff Hostetler
2020-04-20 09:42:48 -04:00
committed by Johannes Schindelin

View File

@@ -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)) {