fix: use fsync for osx builds

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen
2024-09-29 17:00:27 -04:00
committed by Jari Sundell
parent c1d076f182
commit 5ce84929e4
+4
View File
@@ -129,7 +129,11 @@ DownloadStore::write_bencode(const std::string& filename, const torrent::Object&
if (fd < 0)
goto download_store_save_error;
#ifdef __APPLE__
fsync(fd);
#else
fdatasync(fd);
#endif
::close(fd);
return true;