[Openvpn-devel,openvpn3-linux] Fix non-systemd build

Message ID 20220917094116.1765-1-mader.raphael@gmx.at
State Superseded
Delegated to: David Sommerseth
Headers show
Series [Openvpn-devel,openvpn3-linux] Fix non-systemd build | expand

Commit Message

mader.raphael@gmx.at Sept. 16, 2022, 11:41 p.m. UTC
From: Raphael Mader <mader.raphael@gmx.at>

When building in a non-systemd environment, `#include <systemd/sd-journal.h>` causes the build to break.

Signed-off-by: Raphael Mader <mader.raphael@gmx.at>
---
 src/log/logwriters/journald.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.37.3.windows.1

Patch

diff --git a/src/log/logwriters/journald.cpp b/src/log/logwriters/journald.cpp
index f0fc85f..beb06b0 100644
--- a/src/log/logwriters/journald.cpp
+++ b/src/log/logwriters/journald.cpp
@@ -23,6 +23,8 @@ 
  * @brief  Implementation of JournaldWriter
  */

+#ifdef HAVE_SYSTEMD
+
 #include <sys/uio.h>
 #include <ctype.h>
 #include <string>
@@ -34,8 +36,6 @@ 
 #include "log/logwriters/journald.hpp"


-#ifdef HAVE_SYSTEMD
-
 JournaldWriter::JournaldWriter()
     : LogWriter()
 {