Code

Fix compilation with GCC when _GNU_SOURCE isn't defined.
[sysdb.git] / src / tools / sysdbd / main.c
index 25f6499feecc4817903a4ccf13105c43d81ad08c..7bfbaa650c2888c5c30e183c89eb873768c5c8d3 100644 (file)
@@ -33,6 +33,7 @@
 #include "core/plugin.h"
 #include "core/store.h"
 #include "utils/error.h"
+#include "utils/ssl.h"
 
 #include "frontend/connection.h"
 #include "frontend/sock.h"
@@ -46,6 +47,7 @@
 #endif /* ! HAVE_LIBGEN_H */
 
 #include <errno.h>
+#include <time.h>
 
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -60,9 +62,6 @@
 
 #include <pthread.h>
 
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-
 #ifndef CONFIGFILE
 #      define CONFIGFILE SYSCONFDIR"/sysdb/sysdbd.conf"
 #endif
@@ -370,9 +369,8 @@ main(int argc, char **argv)
                if (daemonize())
                        exit(1);
 
-       SSL_load_error_strings();
-       OpenSSL_add_ssl_algorithms();
-
+       if (sdb_ssl_init())
+               exit(1);
        sdb_plugin_init_all();
        plugin_main_loop.default_interval = SECS_TO_SDB_TIME(60);
 
@@ -397,8 +395,7 @@ main(int argc, char **argv)
                        SDB_VERSION_EXTRA" (pid %i)", (int)getpid());
        sdb_plugin_shutdown_all();
        sdb_plugin_unregister_all();
-
-       ERR_free_strings();
+       sdb_ssl_shutdown();
        return status;
 } /* main */