summaryrefslogtreecommitdiff
path: root/src/update-utmp
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-12-08 08:02:34 +0100
committerSven Eden <yamakuzure@gmx.net>2017-12-08 17:54:19 +0100
commitb2ba58acabda1830f0e58ba0d623861a126c43bf (patch)
tree0ffbb2698889e33259bb34444caaff1a04f5ce18 /src/update-utmp
parent350ba9b9374ce045ead8c85c6c2e055729026c0e (diff)
Apply missing updates from upstream
Diffstat (limited to 'src/update-utmp')
-rw-r--r--src/update-utmp/update-utmp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index d69a798eb..abf6af182 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -21,7 +21,7 @@
#include <string.h>
#include <unistd.h>
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
#include <libaudit.h>
#endif
@@ -46,7 +46,7 @@
#include "update-utmp.h"
typedef struct Context {
sd_bus *bus;
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
int audit_fd;
#endif
} Context;
@@ -131,7 +131,7 @@ static int on_reboot(Context *c) {
/* We finished start-up, so let's write the utmp
* record and send the audit msg */
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
if (c->audit_fd >= 0)
if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
errno != EPERM) {
@@ -164,7 +164,7 @@ static int on_shutdown(Context *c) {
/* We started shut-down, so let's write the utmp
* record and send the audit msg */
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
if (c->audit_fd >= 0)
if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
errno != EPERM) {
@@ -209,7 +209,7 @@ static int on_runlevel(Context *c) {
if (previous == runlevel)
return 0;
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
if (c->audit_fd >= 0) {
_cleanup_free_ char *s = NULL;
@@ -239,7 +239,7 @@ int main(int argc, char *argv[]) {
void update_utmp(int argc, char* argv[], sd_bus *bus) {
#endif // 0
Context c = {
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
.audit_fd = -1
#endif
};
@@ -267,7 +267,7 @@ void update_utmp(int argc, char* argv[], sd_bus *bus) {
assert(bus);
#endif // 0
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
/* If the kernel lacks netlink or audit support,
* don't worry about it. */
c.audit_fd = audit_open();
@@ -305,7 +305,7 @@ finish:
else if (streq(argv[1], "shutdown"))
(void)on_shutdown(&c);
#endif // 0
-#ifdef HAVE_AUDIT
+#if HAVE_AUDIT
if (c.audit_fd >= 0)
audit_close(c.audit_fd);
#endif