summaryrefslogtreecommitdiff
path: root/src/shared/utmp-wtmp.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-04-24 15:31:29 +0200
committerDaniel Mack <daniel@zonque.org>2015-04-24 17:48:12 +0200
commit99f710dde855f7ecb699ddac6ad77923c1f6bc85 (patch)
tree3fb5bb95bd9eeb0ad1839285b08ae0665cf76e50 /src/shared/utmp-wtmp.h
parent8aaa023ae78f3cb28db3edd87f96b21486810b91 (diff)
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.
Diffstat (limited to 'src/shared/utmp-wtmp.h')
-rw-r--r--src/shared/utmp-wtmp.h15
1 files changed, 12 insertions, 3 deletions
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;
}