From a5354311095be9d40989ea4fa33d0290d4d9da39 Mon Sep 17 00:00:00 2001 From: bescoto Date: Fri, 13 Jan 2006 05:29:47 +0000 Subject: If fsync fails, make sure descriptor still closed git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@745 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/rpath.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 7fed29c..8d6a302 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -1148,6 +1148,7 @@ class RPath(RORPath): os.fsync(fd) os.close(fd) except OSError, e: + if locals().has_key('fd'): os.close(fd) if e.errno != errno.EPERM or self.isdir(): raise # Maybe the system doesn't like read-only fsyncing. -- cgit v1.2.1