summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/build.h7
-rw-r--r--src/shared/utmp-wtmp.h28
2 files changed, 35 insertions, 0 deletions
diff --git a/src/core/build.h b/src/core/build.h
index a7f12a33e4..d5e55506cf 100644
--- a/src/core/build.h
+++ b/src/core/build.h
@@ -63,6 +63,12 @@
#define _SYSVINIT_FEATURE_ "-SYSVINIT"
#endif
+#ifdef HAVE_UTMP
+#define _UTMP_FEATURE_ "+UTMP"
+#else
+#define _UTMP_FEATURE_ "-UTMP"
+#endif
+
#ifdef HAVE_LIBCRYPTSETUP
#define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP"
#else
@@ -137,6 +143,7 @@
_APPARMOR_FEATURE_ " " \
_SMACK_FEATURE_ " " \
_SYSVINIT_FEATURE_ " " \
+ _UTMP_FEATURE_ " " \
_LIBCRYPTSETUP_FEATURE_ " " \
_GCRYPT_FEATURE_ " " \
_GNUTLS_FEATURE_ " " \
diff --git a/src/shared/utmp-wtmp.h b/src/shared/utmp-wtmp.h
index 040a16e746..87d004e615 100644
--- a/src/shared/utmp-wtmp.h
+++ b/src/shared/utmp-wtmp.h
@@ -23,6 +23,7 @@
#include "util.h"
+#ifdef HAVE_UTMP
int utmp_get_runlevel(int *runlevel, int *previous);
int utmp_put_shutdown(void);
@@ -33,3 +34,30 @@ 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, 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 */