Skip to content

Commit 1ff93e4

Browse files
jeffhostetlerGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge pull request #2589 from jeffhostetler/unlink-perf-gfw
mingw: improve performance of mingw_unlink()
2 parents 8cc796f + 9c1dcc4 commit 1ff93e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compat/mingw.c

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ int mingw_unlink(const char *pathname)
290290
if (xutftowcs_path(wpathname, pathname) < 0)
291291
return -1;
292292

293+
if (DeleteFileW(wpathname))
294+
return 0;
295+
293296
/* read-only files cannot be removed */
294297
_wchmod(wpathname, 0666);
295298
while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {

0 commit comments

Comments
 (0)