X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Futmp-wtmp.h;h=87d004e615f78fd433abf110dc4644c0cb9240af;hp=040a16e7465f8792440a7ad6d98c5e5fe797e1ab;hb=553d2243e2a42783b8bb94addfb752b802c23311;hpb=9003d9b0d628be059922e522fd35f9c5b4d8b039 diff --git a/src/shared/utmp-wtmp.h b/src/shared/utmp-wtmp.h index 040a16e74..87d004e61 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 */