1
0
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:
Bryan Roe
2019-03-01 15:31:43 -08:00
parent c130fb9d89
commit b25a54c8b5

View File

@@ -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