added config and tls
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
This commit is contained in:
1 parent
28655e7b46
commit
4c7a156723
10 files changed
+274
-10
No files matched your search
+2
-1
@@ -3,12 +3,13 @@
|
||||
#include <stdlib.h>
|
||||
#include "sql.h"
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
|
||||
sqlite3* db = nullptr;
|
||||
pthread_mutex_t db_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void init_db() {
|
||||
if (sqlite3_open("users.db", &db) != SQLITE_OK) {
|
||||
if (sqlite3_open(cm_get_parameter_as_string(config, "database"), &db) != SQLITE_OK) {
|
||||
fprintf(stderr, "Cannot open database: %s\n", sqlite3_errmsg(db));
|
||||
sqlite3_close(db);
|
||||
exit(1);
|
||||
|
||||
Reference in new issue
Block a user