Skip to content

Commit

Permalink
Merge pull request #2589 from jeffhostetler/unlink-perf-gfw
Browse files Browse the repository at this point in the history
mingw: improve performance of mingw_unlink()
  • Loading branch information
jeffhostetler authored and Git for Windows Build Agent committed Apr 20, 2020
2 parents 112d9bc + 88d2d4e commit d85328e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ int mingw_unlink(const char *pathname)
if (xutftowcs_long_path(wpathname, pathname) < 0)
return -1;

if (DeleteFileW(wpathname))
return 0;

do {
/* read-only files cannot be removed */
_wchmod(wpathname, 0666);
Expand Down

0 comments on commit d85328e

Please sign in to comment.