summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-05-21 11:36:47 +0200
committerJonas Smedegaard <dr@jones.dk>2017-05-21 11:36:47 +0200
commitde62b6456bebd130f98ce6192cd63ff42e654fac (patch)
tree9c031f6dbc92bc33f7f10307b6b1ed5f928d91fe /src/main.cpp
parentf820d86aadb7a5473bcc0a0a3669732ab0182555 (diff)
parent25d46924bc2edd079d4d996d1d76d702d724341e (diff)
downloadbiboumi-de62b6456bebd130f98ce6192cd63ff42e654fac.tar.gz
biboumi-de62b6456bebd130f98ce6192cd63ff42e654fac.tar.bz2
biboumi-de62b6456bebd130f98ce6192cd63ff42e654fac.tar.xz
biboumi-de62b6456bebd130f98ce6192cd63ff42e654fac.zip
New upstream version 4.3
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 019dff0..488032d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,7 +12,9 @@
#include <atomic>
#include <signal.h>
-#include <litesql.hpp>
+#ifdef USE_DATABASE
+# include <litesql.hpp>
+#endif
// A flag set by the SIGINT signal handler.
static std::atomic<bool> stop(false);
@@ -83,11 +85,14 @@ int main(int ac, char** av)
if (hostname.empty())
return config_help("hostname");
+
+#ifdef USE_DATABASE
try {
- open_database();
- } catch (const litesql::DatabaseError&) {
- return 1;
- }
+ open_database();
+ } catch (const litesql::DatabaseError&) {
+ return 1;
+ }
+#endif
// Block the signals we want to manage. They will be unblocked only during
// the epoll_pwait or ppoll calls. This avoids some race conditions,