mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 17:57:59 +00:00
SyncFile: fix use of fd object after close
This commit is contained in:
parent
ca0c1dab11
commit
fc8be58b63
1 changed files with 2 additions and 1 deletions
|
@ -829,8 +829,9 @@ def close_segment(self):
|
|||
# tell the OS that it does not need to cache what we just wrote,
|
||||
# avoids spoiling the cache for the OS and other processes.
|
||||
os.posix_fadvise(self._write_fd.fileno(), 0, 0, os.POSIX_FADV_DONTNEED)
|
||||
dirname = os.path.dirname(self._write_fd.name)
|
||||
self._write_fd.close()
|
||||
sync_dir(os.path.dirname(self._write_fd.name))
|
||||
sync_dir(dirname)
|
||||
self._write_fd = None
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue