From 2c71060d25f18e75ae14154bf50d24909e2872c1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 9 Nov 2015 17:24:58 +0100 Subject: Check return value of sodium_init() Fixes a warning with -Wunused-result. --- src/fastd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fastd.c b/src/fastd.c index 2d0b47a..8723add 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -481,7 +481,8 @@ static inline void init_config(int *status_fd) { /* Init crypto libs here as fastd_config_check() initializes the methods and might need them */ #ifdef HAVE_LIBSODIUM - sodium_init(); + if (sodium_init() < 0) + exit_error("unable to initialize libsodium"); #endif #ifdef ENABLE_OPENSSL -- cgit v1.2.3