mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-06 22:29:23 +00:00
Check the flush on the dht cache and history
good() ran before close(), so a failed write replaced the file.
This commit is contained in:
@@ -132,11 +132,12 @@ DhtManager::save_dht_cache() {
|
||||
torrent::Object cache = torrent::Object::create_map();
|
||||
cache_file << *torrent::runtime::network_manager()->dht_controller()->store_cache(&cache);
|
||||
|
||||
// The data only reaches the kernel here, so this is where a full disk is seen.
|
||||
cache_file.close();
|
||||
|
||||
if (!cache_file.good())
|
||||
return;
|
||||
|
||||
cache_file.close();
|
||||
|
||||
::rename(filename_tmp.c_str(), filename.c_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user