summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 03:45:34 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 03:45:34 +0100
commitbb324029ad442a1f6dd7049a6e6fc1cbe4a05799 (patch)
treee3f3e7c33a8077ba5bc721009dd71ea8644f1c1d /src/fastd.c
parentfc8c8d82f05911836208cc9169e103d5578ffd70 (diff)
downloadfastd-bb324029ad442a1f6dd7049a6e6fc1cbe4a05799.tar
fastd-bb324029ad442a1f6dd7049a6e6fc1cbe4a05799.zip
Allow using libsodium instead of NaCl
As libsodium has some strange include files (like a version.h), we try to use absolute include paths whenever possible in fastd now and rename our generated headers.
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c
index c434216..ea197d3 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -28,7 +28,7 @@
#include "crypto.h"
#include "handshake.h"
#include "peer.h"
-#include <version.h>
+#include <fastd_version.h>
#include <fcntl.h>
#include <grp.h>
@@ -39,6 +39,10 @@
#include <syslog.h>
#include <sys/resource.h>
+#ifdef USE_LIBSODIUM
+#include <sodium/core.h>
+#endif
+
static volatile bool sighup = false;
static volatile bool terminate = false;
@@ -751,6 +755,10 @@ static void drop_caps(fastd_context_t *ctx) {
}
int main(int argc, char *argv[]) {
+#ifdef USE_LIBSODIUM
+ sodium_init();
+#endif
+
fastd_context_t ctx = {};
close_fds(&ctx);