* Support read-only access to the database.

This commit is contained in:
Eelco Dolstra 2010-02-24 16:44:43 +00:00
parent e33f67ff0b
commit af565c348a
1 changed files with 5 additions and 1 deletions

View File

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