1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 09:47:58 +00:00

Merge pull request #5272 from ThomasWaldmann/fix-locking-openindiana

fix locking on openindiana, fixes #5271
This commit is contained in:
TW 2020-07-26 18:17:54 +02:00 committed by GitHub
commit 5ebde5cebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,7 +171,7 @@ def release(self):
try:
os.rmdir(self.path)
except OSError as err:
if err.errno not in (errno.ENOTEMPTY, errno.ENOENT):
if err.errno not in (errno.ENOTEMPTY, errno.EEXIST, errno.ENOENT):
# EACCES or EIO or ... = we cannot operate anyway, so re-throw
raise err
# else:
@ -224,7 +224,7 @@ def kill_stale_lock(self):
try:
os.rmdir(self.path)
except OSError as err:
if err.errno == errno.ENOTEMPTY or err.errno == errno.ENOENT:
if err.errno in (errno.ENOTEMPTY, errno.EEXIST, errno.ENOENT):
# Directory is not empty or doesn't exist any more = we lost the race to somebody else--which is ok.
return False
# EACCES or EIO or ... = we cannot operate anyway