Commit 38826758 authored by bescoto's avatar bescoto

If fsync fails, make sure descriptor still closed


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@745 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent c965b044
...@@ -1148,6 +1148,7 @@ class RPath(RORPath): ...@@ -1148,6 +1148,7 @@ class RPath(RORPath):
os.fsync(fd) os.fsync(fd)
os.close(fd) os.close(fd)
except OSError, e: except OSError, e:
if locals().has_key('fd'): os.close(fd)
if e.errno != errno.EPERM or self.isdir(): raise if e.errno != errno.EPERM or self.isdir(): raise
# Maybe the system doesn't like read-only fsyncing. # Maybe the system doesn't like read-only fsyncing.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment