[Core] Only fsync the directory if GNU constant exists
* Doesn't exist on Windows.
This commit is contained in:
parent
e75e65b2c1
commit
da80f7cbda
|
@ -756,9 +756,10 @@ 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
|
||||||
dirfd = os.open(os.path.dirname(filepath), os.O_DIRECTORY)
|
if hasattr(os, 'O_DIRECTORY'):
|
||||||
os.fsync(dirfd)
|
dirfd = os.open(os.path.dirname(filepath), os.O_DIRECTORY)
|
||||||
os.close(dirfd)
|
os.fsync(dirfd)
|
||||||
|
os.close(dirfd)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_queue_position(self, torrent_id):
|
def get_queue_position(self, torrent_id):
|
||||||
|
|
Loading…
Reference in New Issue