audit: initialize audit only if it is enabled

This commit is contained in:
Lennart Poettering 2010-08-11 17:52:01 +02:00
parent eaf9102011
commit e543deaeb5
1 changed files with 2 additions and 0 deletions

View File

@ -251,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;