From 99f710dde855f7ecb699ddac6ad77923c1f6bc85 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Fri, 24 Apr 2015 15:31:29 +0200 Subject: shared/utmp-wtmp: add parameter for origin tty and callback userdata Instead of looking up the tty from STDIN, let utmp_wall() take an argument to specify an origin tty for the wall message. Only if that argument is NULL do the STDIN lookup. Also add an void *userdata argument that is handed back to the callback function. --- src/shared/utmp-wtmp.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/shared/utmp-wtmp.h') diff --git a/src/shared/utmp-wtmp.h b/src/shared/utmp-wtmp.h index 87d004e615..6ac2c7b1c7 100644 --- a/src/shared/utmp-wtmp.h +++ b/src/shared/utmp-wtmp.h @@ -33,7 +33,12 @@ 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, const char *username, bool (*match_tty)(const char *tty)); +int utmp_wall( + const char *message, + const char *username, + const char *origin_tty, + bool (*match_tty)(const char *tty, void *userdata), + void *userdata); #else /* HAVE_UTMP */ @@ -55,8 +60,12 @@ static inline int utmp_put_dead_process(const char *id, pid_t pid, int code, int 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)) { +static inline int utmp_wall( + const char *message, + const char *username, + const char *origin_tty, + bool (*match_tty)(const char *tty, void *userdata), + void *userdata); return 0; } -- cgit v1.2.3-54-g00ecf