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 committed Apr 20, 2020
2 parents a12503a + 8827753 commit 06995d4
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 06995d4

Please sign in to comment.