Commit 1bcdaba2 by Carson Howard Committed by Edward Thomson

fixed win32 p_unlink retry sleep issue

Fixed an issue where the retry logic on p_unlink sleeps before it tries setting a file to write mode causing unnecessary slowdown.
parent 8149f850
...@@ -243,6 +243,11 @@ GIT_INLINE(int) unlink_once(const wchar_t *path) ...@@ -243,6 +243,11 @@ GIT_INLINE(int) unlink_once(const wchar_t *path)
if (DeleteFileW(path)) if (DeleteFileW(path))
return 0; return 0;
set_errno();
if (errno == EACCES && ensure_writable(path) == 0 && DeleteFileW(path))
return 0;
if (last_error_retryable()) if (last_error_retryable())
return GIT_RETRY; return GIT_RETRY;
...@@ -257,7 +262,7 @@ int p_unlink(const char *path) ...@@ -257,7 +262,7 @@ int p_unlink(const char *path)
if (git_win32_path_from_utf8(wpath, path) < 0) if (git_win32_path_from_utf8(wpath, path) < 0)
return -1; return -1;
do_with_retries(unlink_once(wpath), ensure_writable(wpath)); do_with_retries(unlink_once(wpath), 0);
} }
int p_fsync(int fd) int p_fsync(int fd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment