From 37161c5148396448921841ae1026b281c7949652 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Wed, 24 Sep 2014 17:25:00 +0200 Subject: make utmp/wtmp support configurable This adds --disable-utmp option to configure. If it is used, all utmp-related functionality, including querying runlevel support, is removed. --- src/shared/utmp-wtmp.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/shared/utmp-wtmp.h') 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 */ -- cgit v1.2.3-54-g00ecf