mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
[Core] Only fsync the directory if GNU constant exists
* Doesn't exist on Windows.
This commit is contained in:
parent
e75e65b2c1
commit
da80f7cbda
1 changed files with 4 additions and 3 deletions
|
@ -756,6 +756,7 @@ class TorrentManager(component.Component):
|
||||||
os.rename(filepath_bak, filepath)
|
os.rename(filepath_bak, filepath)
|
||||||
else:
|
else:
|
||||||
# Sync the rename operations for the directory
|
# Sync the rename operations for the directory
|
||||||
|
if hasattr(os, 'O_DIRECTORY'):
|
||||||
dirfd = os.open(os.path.dirname(filepath), os.O_DIRECTORY)
|
dirfd = os.open(os.path.dirname(filepath), os.O_DIRECTORY)
|
||||||
os.fsync(dirfd)
|
os.fsync(dirfd)
|
||||||
os.close(dirfd)
|
os.close(dirfd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue