chiark / gitweb /
tree-wide: remove unnecessary LOG_PRI
[elogind.git] / src / shared / utmp-wtmp.h
index ab950617a1a1104a8913dd78d4fec63a1faf1fe6..87d004e615f78fd433abf110dc4644c0cb9240af 100644 (file)
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooutmpwtmphfoo
-#define fooutmpwtmphfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -24,6 +23,7 @@
 
 #include "util.h"
 
+#ifdef HAVE_UTMP
 int utmp_get_runlevel(int *runlevel, int *previous);
 
 int utmp_put_shutdown(void);
@@ -33,6 +33,31 @@ int utmp_put_runlevel(int runlevel, int previous);
 int utmp_put_dead_process(const char *id, pid_t pid, int code, int status);
 int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line);
 
-int utmp_wall(const char *message, bool (*match_tty)(const char *tty));
-
-#endif
+int utmp_wall(const char *message, const char *username, bool (*match_tty)(const char *tty));
+
+#else /* HAVE_UTMP */
+
+static inline int utmp_get_runlevel(int *runlevel, int *previous) {
+        return -ESRCH;
+}
+static inline int utmp_put_shutdown(void) {
+        return 0;
+}
+static inline int utmp_put_reboot(usec_t timestamp) {
+        return 0;
+}
+static inline int utmp_put_runlevel(int runlevel, int previous) {
+        return 0;
+}
+static inline int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
+        return 0;
+}
+static inline int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line) {
+        return 0;
+}
+static inline int utmp_wall(const char *message, const char *username,
+                bool (*match_tty)(const char *tty)) {
+        return 0;
+}
+
+#endif /* HAVE_UTMP */