1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 09:11:47 +02:00

Replace 'bool sync' with an enum for clarity

And drop writeFileAndSync().
This commit is contained in:
Eelco Dolstra 2025-06-12 12:14:04 +02:00 committed by Jörg Thalheim
parent 479c356510
commit a4b5584fb1
4 changed files with 21 additions and 36 deletions

View file

@ -247,7 +247,7 @@ LocalStore::LocalStore(ref<const Config> config)
else if (curSchema == 0) { /* new store */
curSchema = nixSchemaVersion;
openDB(*state, true);
writeFileAndSync(schemaPath, fmt("%1%", curSchema), 0666);
writeFile(schemaPath, fmt("%1%", curSchema), 0666, FsSync::Yes);
}
else if (curSchema < nixSchemaVersion) {
@ -298,7 +298,7 @@ LocalStore::LocalStore(ref<const Config> config)
txn.commit();
}
writeFileAndSync(schemaPath, fmt("%1%", nixSchemaVersion), 0666);
writeFile(schemaPath, fmt("%1%", nixSchemaVersion), 0666, FsSync::Yes);
lockFile(globalLock.get(), ltRead, true);
}