chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
audit: initialize audit only if it is enabled
[elogind.git]
/
src
/
manager.c
diff --git
a/src/manager.c
b/src/manager.c
index 25eb4e70bef568490018b294a2297bd1361d958e..a5b0ce002d1a0f292df4930504a7879345ffd1de 100644
(file)
--- a/
src/manager.c
+++ b/
src/manager.c
@@
-27,7
+27,6
@@
#include <sys/signalfd.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/signalfd.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <utmpx.h>
#include <sys/poll.h>
#include <sys/reboot.h>
#include <sys/ioctl.h>
#include <sys/poll.h>
#include <sys/reboot.h>
#include <sys/ioctl.h>
@@
-37,7
+36,10
@@
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
+
+#ifdef HAVE_AUDIT
#include <libaudit.h>
#include <libaudit.h>
+#endif
#include "manager.h"
#include "hashmap.h"
#include "manager.h"
#include "hashmap.h"
@@
-48,7
+50,6
@@
#include "ratelimit.h"
#include "cgroup.h"
#include "mount-setup.h"
#include "ratelimit.h"
#include "cgroup.h"
#include "mount-setup.h"
-#include "utmp-wtmp.h"
#include "unit-name.h"
#include "dbus-unit.h"
#include "dbus-job.h"
#include "unit-name.h"
#include "dbus-unit.h"
#include "dbus-job.h"
@@
-250,8
+251,10
@@
int manager_new(ManagerRunningAs running_as, Manager **_m) {
if ((r = bus_init(m)) < 0)
goto fail;
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");
if ((m->audit_fd = audit_open()) < 0)
log_error("Failed to connect to audit log: %m");
+#endif
*_m = m;
return 0;
*_m = m;
return 0;