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.
This commit is contained in:
Daniel Mack
2015-04-24 17:48:12 +02:00
parent 8aaa023ae7
commit 99f710dde8
6 changed files with 32 additions and 14 deletions
+2 -2
View File
@@ -251,7 +251,7 @@ static void warn_wall(enum action a) {
}
if (*p) {
utmp_wall(p, NULL, NULL);
utmp_wall(p, NULL, NULL, NULL, NULL);
return;
}
}
@@ -259,7 +259,7 @@ static void warn_wall(enum action a) {
if (!table[a])
return;
utmp_wall(table[a], NULL, NULL);
utmp_wall(table[a], NULL, NULL, NULL, NULL);
}
static bool avoid_bus(void) {