Eliminate one more fsync

This commit is contained in:
John Goerzen 2008-08-02 15:31:43 -05:00
parent fb71fa9638
commit 0da6bedaa0

View File

@ -198,13 +198,14 @@ class MaildirFolder(BaseFolder):
os.path.join(tmpdir, messagename)) os.path.join(tmpdir, messagename))
os.unlink(os.path.join(tmpdir, tmpmessagename)) os.unlink(os.path.join(tmpdir, tmpmessagename))
try: if self.dofsync:
# fsync the directory (safer semantics in Linux) try:
fd = os.open(tmpdir, os.O_RDONLY) # fsync the directory (safer semantics in Linux)
os.fsync(fd) fd = os.open(tmpdir, os.O_RDONLY)
os.close(fd) os.fsync(fd)
except: os.close(fd)
pass except:
pass
self.messagelist[uid] = {'uid': uid, 'flags': [], self.messagelist[uid] = {'uid': uid, 'flags': [],
'filename': os.path.join(tmpdir, messagename)} 'filename': os.path.join(tmpdir, messagename)}