aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-07-16 18:16:04 +0100
committerGitHub <noreply@github.com>2021-07-16 19:16:04 +0200
commitb08e14bbcf1b30c5266d89f6fdcc3a6cfa0324fa (patch)
tree5cb53e07b4f9472ef63cb85ff6f9fab46d35c279 /modules
parent6d8648ce061d404e12f37e2aa0a4c5bed86c330f (diff)
downloadgitea-b08e14bbcf1b30c5266d89f6fdcc3a6cfa0324fa.tar.gz
gitea-b08e14bbcf1b30c5266d89f6fdcc3a6cfa0324fa.zip
Retry rename on lock induced failures (re-fix) (#16461)
Unfortunately #16435 asserts the wrong error and should use os.LinkError not os.PathError. Fix #16439 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/util/remove.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/util/remove.go b/modules/util/remove.go
index 2310436525..754f3b7c11 100644
--- a/modules/util/remove.go
+++ b/modules/util/remove.go
@@ -64,7 +64,7 @@ func Rename(oldpath, newpath string) error {
if err == nil {
break
}
- unwrapped := err.(*os.PathError).Err
+ unwrapped := err.(*os.LinkError).Err
if unwrapped == syscall.EBUSY || unwrapped == syscall.ENOTEMPTY || unwrapped == syscall.EPERM || unwrapped == syscall.EMFILE || unwrapped == syscall.ENFILE {
// try again
<-time.After(100 * time.Millisecond)