[Core] Only fsync the directory if GNU constant exists
* Doesn't exist on Windows.
This commit is contained in:
parent
e75e65b2c1
commit
da80f7cbda
|
@ -756,6 +756,7 @@ class TorrentManager(component.Component):
|
|||
os.rename(filepath_bak, filepath)
|
||||
else:
|
||||
# Sync the rename operations for the directory
|
||||
if hasattr(os, 'O_DIRECTORY'):
|
||||
dirfd = os.open(os.path.dirname(filepath), os.O_DIRECTORY)
|
||||
os.fsync(dirfd)
|
||||
os.close(dirfd)
|
||||
|
|
Loading…
Reference in New Issue