Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
20d30000
Commit
20d30000
authored
Jul 26, 2017
by
Edward Thomson
Committed by
GitHub
Jul 26, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4311 from libgit2/ethomson/win32_remediate
win32: provide fast-path for retrying filesystem operations
parents
e0568621
bc35fd4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
CHANGELOG.md
+3
-0
src/win32/posix_w32.c
+8
-5
No files found.
CHANGELOG.md
View file @
20d30000
...
...
@@ -3,6 +3,9 @@ v0.26 + 1
### Changes or improvements
*
Improved
`p_unlink`
in
`posix_w32.c`
to try and make a file writable
before sleeping in the retry loop to prevent unnecessary calls to sleep.
### API additions
### API removals
...
...
src/win32/posix_w32.c
View file @
20d30000
...
...
@@ -162,12 +162,15 @@ GIT_INLINE(bool) last_error_retryable(void)
#define do_with_retries(fn, remediation) \
do { \
int __tries, __ret; \
for (__tries = 0; __tries < git_win32__retries; __tries++) { \
if (__tries && (__ret = (remediation)) != 0) \
return __ret; \
int __retry, __ret; \
for (__retry = git_win32__retries; __retry; __retry--) { \
if ((__ret = (fn)) != GIT_RETRY) \
return __ret; \
if (__retry > 1 && (__ret = (remediation)) != 0) { \
if (__ret == GIT_RETRY) \
continue; \
return __ret; \
} \
Sleep(5); \
} \
return -1; \
...
...
@@ -186,7 +189,7 @@ static int ensure_writable(wchar_t *path)
if
(
!
SetFileAttributesW
(
path
,
(
attrs
&
~
FILE_ATTRIBUTE_READONLY
)))
goto
on_error
;
return
0
;
return
GIT_RETRY
;
on_error
:
set_errno
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment