mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-24 04:04:31 +00:00
Fixed race condition, where on Linux when you compact the DB, it may not unlock before it reopens
This commit is contained in:
@@ -617,6 +617,9 @@ __EXPORT_TYPE int ILibSimpleDataStore_Compact(ILibSimpleDataStore dataStore)
|
||||
if (root->error == 0)
|
||||
{
|
||||
// Success in writing new temporary file
|
||||
#ifdef _POSIX
|
||||
flock(fileno(root->dataFile), LOCK_UN);
|
||||
#endif
|
||||
fclose(root->dataFile); // Close the data store
|
||||
fclose(compacted); // Close the temporary data store
|
||||
|
||||
|
||||
Reference in New Issue
Block a user