sqlite: Show SQLite library version and thread safety flag during startup
authorMartin Willi <martin@revosec.ch>
Fri, 10 Apr 2015 11:36:26 +0000 (13:36 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 13 Apr 2015 13:31:58 +0000 (15:31 +0200)
src/libstrongswan/plugins/sqlite/sqlite_plugin.c

index f554a9e..7f46ace 100644 (file)
@@ -16,6 +16,7 @@
 #include "sqlite_plugin.h"
 
 #include <library.h>
+#include <sqlite3.h>
 #include "sqlite_database.h"
 
 typedef struct private_sqlite_plugin_t private_sqlite_plugin_t;
@@ -60,6 +61,7 @@ METHOD(plugin_t, destroy, void,
 plugin_t *sqlite_plugin_create()
 {
        private_sqlite_plugin_t *this;
+       int threadsave = 0;
 
        INIT(this,
                .public = {
@@ -71,6 +73,11 @@ plugin_t *sqlite_plugin_create()
                },
        );
 
+#if SQLITE_VERSION_NUMBER >= 3005000
+       threadsave = sqlite3_threadsafe();
+#endif
+       DBG2(DBG_LIB, "using SQLite %s, thread safety %d",
+                sqlite3_libversion(), threadsave);
+
        return &this->public.plugin;
 }
-