chiark / gitweb /
audit: initialize audit only if it is enabled
[elogind.git] / src / manager.c
index e32b24ff516da78bf895e82044f67b474fbeaa13..a5b0ce002d1a0f292df4930504a7879345ffd1de 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+
+#ifdef HAVE_AUDIT
 #include <libaudit.h>
+#endif
 
 #include "manager.h"
 #include "hashmap.h"
@@ -248,8 +251,10 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
         if ((r = bus_init(m)) < 0)
                 goto fail;
 
+#ifdef HAVE_AUDIT
         if ((m->audit_fd = audit_open()) < 0)
                 log_error("Failed to connect to audit log: %m");
+#endif
 
         *_m = m;
         return 0;