Move sodium_init() to initLibStore()

Part of an effort to make it easier to initialize the right things,
by moving code into the appropriate libraries.
This commit is contained in:
Robert Hensing 2023-02-01 17:12:11 +01:00
parent 9693076715
commit a58be39476
2 changed files with 5 additions and 5 deletions

View file

@ -28,8 +28,6 @@
#include <openssl/crypto.h>
#include <sodium.h>
namespace nix {
@ -164,9 +162,6 @@ void initNix()
initLibUtil();
initLibStore();
if (sodium_init() == -1)
throw Error("could not initialise libsodium");
startSignalHandlerThread();
/* Reset SIGCHLD to its default. */

View file

@ -13,6 +13,8 @@
#include <nlohmann/json.hpp>
#include <sodium/core.h>
namespace nix {
@ -292,6 +294,9 @@ void assertLibStoreInitialized() {
void initLibStore() {
if (sodium_init() == -1)
throw Error("could not initialise libsodium");
loadConfFile();
initLibStoreDone = true;