diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-09-20 07:53:24 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-09-20 07:53:24 +0000 |
commit | f9fd352f38c3c3d9e7824b8cf84b8f86e2a6d392 (patch) | |
tree | cbb01b76f47c50e7bf86443d0bb37747b41b8cff /src/irmd/main.c | |
parent | 476a3fe224554780b5737ac8db8f9fd39b32fe14 (diff) | |
parent | c665c71719225ef6d076c6be24c588049527f31f (diff) | |
download | ouroboros-f9fd352f38c3c3d9e7824b8cf84b8f86e2a6d392.tar.gz ouroboros-f9fd352f38c3c3d9e7824b8cf84b8f86e2a6d392.zip |
Merged in dstaesse/ouroboros/be-gcrypt-init (pull request #602)
irmd: Init libgcrypt before using it
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r-- | src/irmd/main.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index df903f40..27c771a6 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -59,6 +59,10 @@ #include <sys/stat.h> #include <sys/wait.h> +#ifdef HAVE_LIBGCRYPT +#include <gcrypt.h> +#endif + #define IRMD_CLEANUP_TIMER ((IRMD_FLOW_TIMEOUT / 20) * MILLION) /* ns */ #define SHM_SAN_HOLDOFF 1000 /* ms */ #define IPCP_HASH_LEN(e) hash_len(e->dir_hash_algo) @@ -2260,6 +2264,14 @@ static int irm_init(void) else mkdir(FUSE_PREFIX, 0777); #endif + +#ifdef HAVE_LIBGCRYPT + if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P)) + goto fail_gcry_control; + + gcry_control(GCRYCTL_INITIALIZATION_FINISHED); +#endif + irmd.csockfd = -1; irmd.state = IRMD_RUNNING; @@ -2267,6 +2279,10 @@ static int irm_init(void) return 0; +#ifdef HAVE_LIBGCRYPT + fail_gcry_control: + shm_rdrbuff_destroy(irmd.rdrb); +#endif fail_rdrbuff: shm_rdrbuff_destroy(irmd.rdrb); fail_sock_opt: |