1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-10 11:01:03 +01:00

* In normaliseFState(), wrap registration of the output paths and the

normal form in a single transaction to ensure that if we crash,
  either everything is registered or nothing is.  This is for
  recoverability: unregistered paths in the store can be deleted
  arbitrarily, while registered paths can only be deleted by running
  the garbage collector.
This commit is contained in:
Eelco Dolstra 2003-08-01 15:41:47 +00:00
parent d99d04e644
commit c95b4ad290
6 changed files with 44 additions and 28 deletions

View file

@ -4,6 +4,7 @@
#include <string>
#include "hash.hh"
#include "db.hh"
using namespace std;
@ -20,7 +21,8 @@ void copyPath(string src, string dst);
void registerSubstitute(const FSId & srcId, const FSId & subId);
/* Register a path keyed on its id. */
void registerPath(const string & path, const FSId & id);
void registerPath(const Transaction & txn,
const string & path, const FSId & id);
/* Query the id of a path. */
bool queryPathId(const string & path, FSId & id);