aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2010-01-15 23:03:32 +0100
committerNikolaus Schulz <microschulz@web.de>2010-07-19 01:40:25 +0200
commit4fb833176e9af7eaba801fdad14c3f3f174c4316 (patch)
treed6eb8bed4b31821fcc2d7888527c9a0916b3e9c1
parent2b7baaf29435960d3e77fe2836426d9da72819e2 (diff)
downloadarchivemail-4fb833176e9af7eaba801fdad14c3f3f174c4316.tar.gz
archivemail-4fb833176e9af7eaba801fdad14c3f3f174c4316.tar.bz2
archivemail-4fb833176e9af7eaba801fdad14c3f3f174c4316.zip
When creating a dotlock, register it slightly earlier for cleanup
This closes a very unlikely window where we could create a dotlock file, but then encounter an error and fail to clean up the dotlock.
-rwxr-xr-xarchivemail.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/archivemail.py b/archivemail.py
index 6658746..4adf6b1 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -398,11 +398,11 @@ class LockableMboxMixin:
raise LockUnavailable("Dotlock for '%s' unavailable" % self.mbox_file_name)
else:
raise
+ _stale.dotlock_files.append(lock_name)
finally:
os.close(plfd)
os.unlink(prelock_name)
vprint("acquired lockfile '%s'" % lock_name)
- _stale.dotlock_files.append(lock_name)
def _dotlock_unlock(self):
"""Delete the dotlock file for the 'mbox' mailbox."""