diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-02-24 16:44:43 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-02-24 16:44:43 +0000 |
commit | af565c348a286fb55ad17f8c3c4233465d32a9f6 (patch) | |
tree | a7f19c633efc41009d31487542f658a6e1794747 /src | |
parent | e33f67ff0b02cc8fc2e0024dd87a6d61467df177 (diff) |
* Support read-only access to the database.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/local-store.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 7e205a9bf..95e775ce7 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -173,7 +173,10 @@ LocalStore::LocalStore() schemaPath = nixDBPath + "/schema"; - if (readOnlyMode) return; + if (readOnlyMode) { + openDB(false); + return; + } /* Create missing state directories if they don't already exist. */ createDirs(nixStore); @@ -197,6 +200,7 @@ LocalStore::LocalStore() } catch (SysError & e) { if (e.errNo != EACCES) throw; readOnlyMode = true; + openDB(false); return; } |