mirror of
https://github.com/NixOS/nix.git
synced 2024-10-30 05:40:52 +00:00
Move loadConfFile() to initLibStore
Part of an effort to make it easier to initialize the right things, by moving code into the appropriate libraries. Using libstore without loading the config file is risky, as sqlite may then be misconfigured. See https://github.com/cachix/cachix/issues/475
This commit is contained in:
parent
6e0b7109ab
commit
a692c43729
@ -27,7 +27,6 @@ static ref<Store> store()
|
||||
if (!_store) {
|
||||
try {
|
||||
initLibStore();
|
||||
loadConfFile();
|
||||
settings.lockCPU = false;
|
||||
_store = openStore();
|
||||
} catch (Error & e) {
|
||||
|
@ -166,8 +166,6 @@ void initNix()
|
||||
if (sodium_init() == -1)
|
||||
throw Error("could not initialise libsodium");
|
||||
|
||||
loadConfFile();
|
||||
|
||||
startSignalHandlerThread();
|
||||
|
||||
/* Reset SIGCHLD to its default. */
|
||||
|
@ -291,6 +291,9 @@ void assertLibStoreInitialized() {
|
||||
}
|
||||
|
||||
void initLibStore() {
|
||||
|
||||
loadConfFile();
|
||||
|
||||
initLibStoreDone = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user